Problem with physics interpolation in godot 4.3

In my game, I’ve encountered a problem where enabling physics interpolation causes a “jittery” effect when moving the ground sprite. I’m moving the ground sprite within the Process function. How can I fix this?

func _process(_delta: float):
`if game_running:`
	`scroll += SCROLL_SPEED`
	`scroll_background += SCROLL_BACKGROUND`
	`if scroll >= viewport_rect.end.x:`  
		`scroll = 0`
	`Ground.position.x = -scroll`

To make the interpolation work properly you need to set physics jitter to zero.

Also, it’s a good idea to use the _physics_process() instead of _process when dealing with movement.
This can prevent jitter, and will give you a better performance.

1 Like