I'm creating a 3D platformer, but whenever my player goes down a slope, it thinks it isn't grounded, resulting in a weird animation glitch.

My character has a character controller, and I use ‘controller.isgrounded’ to animate him with jumping and falling. However, whenever he goes down even a tiny slope, the brief frames where he is off the ground result in him rapidly switching between his falling and running frames, which looks terrible. I tried delaying it with a coroutine, but it isn’t working. Is there anyway to stop this glitch?

Nevermind, I fixed it.