Godot Version
4.4
Question
I’m trying to setup my tree sprite to briefly shake on-hit with an axe. I want the tree to shake more on the top than the bottom. I’m using a shader to do this, and my shader code looks like:
shader_type canvas_item;
uniform float shake_intensity = 0.0;
uniform float shake_speed = 20.0;
void vertex() {
if (VERTEX.y < 0.0) {
VERTEX.x += sin(TIME * shake_speed + VERTEX.y) * shake_intensity;
}
}
This looks GREAT in the editor, but when I test my scene with the tree sprite in it, only 2/3 of my tree shakes. It’s like there’s an invisible line just above my bottom set of leaves, and I’m pivoting around that axis. Why would I only see this when testing and not in the editor – what am I missing?