Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GodotPhysics] KinematicBody jitters against floor #49323

Open
Tracked by #45333
nezvers opened this issue Jun 4, 2021 · 2 comments
Open
Tracked by #45333

[GodotPhysics] KinematicBody jitters against floor #49323

nezvers opened this issue Jun 4, 2021 · 2 comments

Comments

@nezvers
Copy link

nezvers commented Jun 4, 2021

Godot version:
3.3.2

OS/device including version:
Win 10

Issue description:
Using Godot physics KinematicBody jitters up and down when walking on the ground. It seems that it's more apparent with bigger collision shapes (happens with extents 50 and not visible with 5).
Behaviour points to some floating point imprecision. A character velocity approaches zero jitter gets more pronounced. Using snap enhances the jitter. Gravity doesn't influence it (enabled/disabled when grounded). Some spots on the ground are continuous even when the character is still.
Bullet physics doesn't have this behavior.

test-fps-controller.mp4

Steps to reproduce:
Basic KinematicBody movement, move_and_slide_with_snap, and snapping to the ground have more pronounced jitter. Floor with bigger shape (extents 50 already has hitter).

Minimal reproduction project:
Godot_physics_floor_jitter.zip

@Oyusi
Copy link

Oyusi commented Aug 10, 2021

I can confirm this issue in 3.3.2.stable with GodotPhysics, it happens with BoxShape, ConcavePolygonShape, and ConvexPolygonShape (the last 2 being created as Siblings from the Mesh dropdown of a simple CubeMesh). I've also encountered it while using a custom implementation with move_and_collide.

I have created a reproduction project more simple than the one provided by the OP. The kinematic body is already standing in a position where it jitters against BoxShape.

You can disable the floor collision shapes to test each separately, the Convex one in particular has bizarre behaviour, where it immediately teleports the KB to a corner.

3.3.2.stable kb bumpy.zip

kb.bumpy.mp4

@Calinou Calinou changed the title Godot physics Kinematic body jitter against floor [GodotPhysics] KinematicBody jitters against floor Aug 10, 2021
@fabriceci
Copy link
Contributor

If you don't apply gravity to the floor, there is no issue which is, I think, a good practice, because when you apply the gravity on a sloping floor, it will affect your movement. That being said, there is indeed a bug in 3.x.

However I recreated the @Oyusi 's project and there is no issue in the master (4.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants