Strange KinematicCharacterControllerOutput behaviour #377
Labels
A-Dynamics
A-Integration
very bevy specific
C-Bug
Something isn't working
D-Medium
P-High
arbitrary important item
S-not-started
Work has not started
Sorry for the vague title, I'm really not sure how to word this succinctly.
I'm trying to make a basic 2D character controller with gravity and collisions. For this, I decided to use the provided
KinematicCharacterController
andVelocity
components to handle collisions and movement respectively.I don't know if it's something I've done wrong, but
grounded
keeps flickering betweentrue
andfalse
every couple of frames if I resetlinvel.y
while not grounded, even when the player collider is nowhere near the ground collider. If you wait for it to fall through, it no longer flickers.I've put together a gist that illustrates the problem.
If you Check the console you'll find something like this repeated over and over:
If you remove Line 47 (the line resetting
linvel.y
), the flickering stops, but the colliders still pass through each other instead of colliding.Extra notes:
linvel.y
to a negative value (down) instead of resetting it to zero,grounded
stops flickering when the player reaches the ground, but then slowly sinks down into it.Ccd
component.KinematicCharacterController.snap_to_ground
does nothing to help.Am I doing something wrong? I thought something like setting the Y velocity to 0 when on the floor would be a relatively simple thing to do.
The text was updated successfully, but these errors were encountered: