Hello UA,
For my game, I have an object with a box collider. When the object is grounded, the player can make the object jump. The thing is though that my script is using
function OnCollisionStay ()
{
grounded = true;
}
This is good and all but if I collide up against a wall and hold the Jump button, the object rises. What I need to do is for grounded to become true ONLY if there is collision from the bottom of the collider. How would I go about doing this? I could use raycasting but I'm not sure if that's the best choice...
Thanks In Advance :)