Issue in State Machine because of "characterController.isGrounded"

You haven’t included the CharacterController code, but beware that incorrect use of CharacterController will now give you grounded errors.

I wrote about this before: the Unity example code in the API no longer jumps reliably.

I reported it to Unity via their docs feedback in October 2020. Apparently it is still broken:

Here is a work-around:

I recommend you also go to that same documentation page and ALSO report that the code is broken.

When you report it, you are welcome to link the above workaround. One day the docs might get fixed.

If you would prefer something more full-featured here is a super-basic starter prototype FPS based on Character Controller (BasicFPCC):

That one has run, walk, jump, slide, crouch… it’s crazy-nutty!!

Also, just beware that making a generic state controller class hierarchy like the above is awesome when it works, and extremely frustrating to debug when it fails, as you are finding out.

This is my position on finite state machines (FSMs):

I’m kind of more of a “get it working first” guy.

Your mileage may vary.