I’m a little unsure about all your logic there… if it works it works, but it seems potentially iffy, especially that weird testing of velocity and setting velocity to gravity.
Here was my use of the CC:
The above code was written to avoid the bug in Unity’s example code that makes jumping fail: you must never call .Move() more than once per frame.
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!!