Circle RigidBody2D jitters and bounces when moving on flat surface

Godot Version

Godot v4.2.1

Question

I’m working on a 2d side scrolling platformer where the player is a perfectly circular RigidBody2D. In attempting to get the ball to accelerate on slopes, we noticed that the ball bounces slightly on the slope, ruining velocity and making the ball’s path unpredictable. Further testing shows this still happens on a flat surface, even at what we’d consider normal speeds. The output of get_contact_local_normal shows that the ball’s normal collision vector is not always perpendicular to the floor it’s own, even if the floor appears smooth:

Console Output for print(collision_normal)

where collision_normal = state.get_contact_local_normal() while ball is rolling to the right on a flat surface

(0, -1)

(0, -1)

(0, -1)

(0, -1)

(0, 0)

(-0.000003, -1)

(0, -1)

(0, -1)

(0, -1)

(0, -1)

(0, -1)

(0, -1)

Troubleshooting so far:

Doesn’t seem to be an issue with velocity addition, as it happens even on a flat surface when velocity.x is the only aspect of velocity affected.

Doesn’t appear to be an issue with our collision on the tilemap, as (while the drawn pixels of the tiles have pixel sized divots) the collision seems visually seamless and flush at high zoom.

Doesn’t appear to be an issue with player collision, as while visually the CircleShape2D collision appears to be a segmented 24 sided polygon, research suggests the collision is handled on the backend as a true circle.

Attempted various combinations of absorbency on player, tilemap, or both, as well as continuous collision detection on the player. Bounces still occurred while moving on a flat surface for prolonged periods of time.

Research suggests this could be an issue with the default physics engine, but the earliest forum threads we could find were from Godot 3, so we’re unsure if this behavior is the same in Godot 4.

We appreciate any help we can get on this. Can also provide minimum requirements to reproduce as needed.

Solved: Attempt to use composite collision as needed on long stretches of platform to avoid tiling collision issues

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.