Closed giancarlo-padilla closed 1 year ago
My camera remains static, in fact I don’t even have a Camera2D in my scene. Could this still be the culprit?
My camera remains static, in fact I don’t even have a Camera2D in my scene. Could this still be the culprit?
The reason is not in Camera2D
, but in the ratio of speed/acceleration of the background/objects and FPS. On a large pixel grid, jerky movement occurs if, for example, an object moves in the first frame by 1 pixel, in the second by 2, in the third again by 1, and so on. If the object moves the same number of pixels in each frame, then the illusion of continuous movement arises, even if the pixels are quite large.
My camera remains static, in fact I don’t even have a Camera2D in my scene. Could this still be the culprit?
The reason is not in
Camera2D
, but in the ratio of speed/acceleration of the background/objects and FPS. On a large pixel grid, jerky movement occurs if, for example, an object moves in the first frame by 1 pixel, in the second by 2, in the third again by 1, and so on. If the object moves the same number of pixels in each frame, then the illusion of continuous movement arises, even if the pixels are quite large.
Do you know of any fix? Or is the issue you linked the main hub for this problem. Sorry just a little confused because the one you linked exclusively talks about this being related to Camera2D. Edit: Also this is not a pixel perfect game, it just uses pixel art sprites.
Do you know of any fix?
There is no way to fix this particular issue without changing your player or camera's movement speed. Mathematics are mathematics – you can't divide 5 by 2 and get an exact integer result, for instance.
Closing in favor of https://github.com/godotengine/godot-docs/issues/7774, as this is not an engine issue. See also https://github.com/godotengine/godot-proposals/issues/6389.
See also:
Godot version
4.1.1
System information
Godot v4.1.1.stable - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1080 (NVIDIA; 31.0.15.3742) - Intel(R) Core(TM) i9-10850K CPU @ 3.60GHz (20 Threads)
Issue description
I have a ParallaxBackground Node that controls two different pixel art images. When I run my game, a very noticeable jitter occurs while they are in motion. It is intended to be a consistent horizontal movement with a fixed speed. I have tried adjusting the various project settings including:
_physics_process()
&_process()
Steps to reproduce
var scroll_speed = Vector2(35, 0)
func _physics_process(delta): scroll_offset -= scroll_speed * delta