I made a simple 3rd person character script that uses a character controller. Gravity is applied every frame through script, and every frame it also checks if the character is grounded through CharacterController.isGrounded, and if this is true extra downward velocity is applied just to ensure that it stays on the ground. After both of these things have happened, it checks if the jump button had been pressed. I used a debug.log to make sure that it is always registering the button click, and it is, but it also checks if the controller is grounded using CharacterController.isGrounded, and only calls the jump function if this is true. The jump button works most of the time, but sometimes it just doesn’t work, meaning the controller thinks it is not grounded when it is. Is there some way to easily fix this? Or should I just use another method of checking for the ground? If so, what method should I use? I hope I worded this question okay.
Edit:
This still happens at seemingly random times, but the one way I am able to consistently recreate this problem is when I come to a complete stop, jump, land completely, then when I try to jump again it won’t work until I move again.