Hi, I was looking to see how I would detect collision between two objects, my player and the floor.
Im trying to give my player the ability to jump when they press the space bar, I tried this out at first
if (Input.GetKey(KeyCode.Space))
{
rigidbody.AddForce(0, 10, 0);
}
But this makes it to where the player flies up continuously if pressed.
What I thought about doing was detecting whether the player was colliding with the floor, and then if true, letting him jump.
Hopefully it would let him go up,then detect that the player was not colliding with the floor, then send him back down.
Please let me know if you need any further info, or if there is a simpler way to do this
Thanks again!