Character controller is not grounded

I just write it infinity runner character script but My character doesn’t fall or can’t jump too How can i fix this.- YouTube

I think it is because you have your direction variable inside of the Update function. This will always set the direction.y to 0 (line 28). Your script is very similar to the example script in the scripting reference, but there are some differences that is making it not work. Check out the link below and compare. Following that example will probably fix your problem.


Bump. I am having the exact same problem. I even copy/pasted the exact script found at the link provided by @metalted but it is still inconsistently grounded; seemingly at arbitrary times. The transform on my end is always at 1.08 when it SHOULD be grounded. At this point I just want to make my own ground detection script; but that defeats the purpose of having a Character Controller component in the first place. Any recommendations, or is this a bug in need of fixing?