Hello!
I am creating a physics based game, and I would like to create a script, which check when is the player on the ground. I have tried it with triggers. I have a collider at the buttom of the player, and I have tried to use it to detect it.
function OnTriggerStay (other : Collider)
{
if (other.tag != "Player")
{
marbleController.onGround = true; //Set the onGround to true
}
}
function OnTriggerLeave (other : Collider)
{
if (other.tag != "Player")
{
marbleController.onGround = false; //Set the onGround to false
}
}
However, it isn’t working. Is there any better way to do this without the character controller?