Quick answer: Godot 4 CharacterBody2D jittering against walls when velocity is zero? move_and_collide with a zero vector still resolves overlap and pushes the body - early-exit when velocity is small.
Player stands against a wall. The sprite shimmers 1 pixel left/right per frame, even though input is neutral.
Guard the call
if velocity.length_squared() > 0.0001:
move_and_collide(velocity * delta)A zero or near-zero velocity still triggers the depenetration step. Guarding eliminates the round-trip and the resulting jitter.
Use move_and_slide instead
move_and_slide internally damps small velocities and is generally the right choice for character movement. Reserve move_and_collide for cases where you need the collision data on a single step.
Check safe_margin
Raise safe_margin on the body slightly (default 0.08). A larger margin reduces the penetration the solver tries to correct and removes a class of single-pixel oscillation.
“Zero velocity isn't zero work - the physics solver still has opinions about your position.”
Visualize the actual delta applied per frame with a debug label - jitter is almost always a sub-pixel motion problem that becomes visible at integer rendering.