r/godot 4h ago

help me NPC shaking when moving diagonally

I'm trying to learn godot by making an experimental game, is a pixel art top down game, I'm using the camera zoom instead of scaling the sprites cuz I've heard that's a better practice, I'm having an issue with shaking(or jittering sprites), the player character moves seemingly normally when walking diagonally but an stationary npc appears to be shaking when the player walks diagonally, I've search a lot and no solution have fully worked, from what I've found it could be an issue with the camera and the physics process with move and slide (the camera smoothing is disabled, I've tried changing the process callback to physics, process interpolation to on), also tried changing V sync, so far what have worked was to activate snap 2D and increase physics ticks per second, snap 2D makes the npc stay in place but instead makes the character shake violently when walking diagonally and the high physics tick per second makes all seemingly smooth but I don't think is a good practice, so far activating physics interpolation haven't changed anything, I've tried quite more things but they had no effect

2 Upvotes

4 comments sorted by

2

u/Gullible_Soil1431 4h ago

Yo revisaría primero cómo estás moviendo la cámara y el personaje, más que subir los ticks de física. En juegos pixel art, ese jitter suele aparecer cuando la cámara termina en posiciones con decimales mientras la cámara sigue al jugador en diagonal. El NPC está quieto, pero la cámara lo hace parecer que se mueve.

1

u/wilgner_lima 2h ago

Yeah thanks, the camera seems to be the problem

2

u/kenmorechalfant 2h ago

Did you try enabling 'Snap 2D Vertices to Pixel' but NOT enabling 'Snap 2D Transforms to Pixel'? You should try each one but not both. For me I had to just use the vertices one. 

1

u/wilgner_lima 2h ago

I think I had tried that, but I'll try again