best way to determine if a character is grounded?

I’m making a 3d platformer game and I managed to code a double jump that kind of works, I’m using OnCollisionEnter and OnCollisionStay to determine if my character is grounded, it works alright but the problem is that if my character hits the ceiling with its head or the walls with any of the sides of its collider my code automatically assumes the character is grounded and allows it to jump indefinitely!

is there any way to make the OnCollisionEnter and OnCollisionStay functions to detect when it’s colliding with only the lower part of my character’s collider?

Thanks!

I just tried with a combination of OnCollisionEnter AND raycasts, seems to be working fine for now! but let’s see in the future, thank you so much guys! :smiley:

Take a look at this comprehensive tutorial:

It shows how to deal with the ceiling issue by pushing the cahracter away from it before the jump zenit is reached.