CharacterController.isGrounded is broken?

I’m trying to implement jumping in my script using a characterController on the gameobject.
But it keeps switching between true and false for on grounded. If I take the gravity off it just stays on false.
Wanted to use the is grounded as an indicator for the animator to trigger the jump animation, but this looks to be a hopeless case.
Looks to be a problem since way back when (found the issue in forums going back to 2011)
Is this on the cards to be fixed any time soon?

There’s nothing to fix. isGrounded works perfectly fine. You just need to pay careful attention to what it does:

That means it only tells you if the CC was grounded the last time you called Move or SimpleMove.

This can easily get messed up especially if you call Move more than once in your code. Also pay careful attention to if you are checking it before or after your Move call.

For the record, the example code that Unity provides on their website IS BROKEN.

I wrote about this before: the Unity example code in the API no longer jumps reliably. I have reported it. Here is a work-around:

1 Like