I made a simple jump script with the help of some youtube video’s but there is one Problem with the script that makes it so you can climp walls if you collide with them does any one know how to fix this and if possible translate it to C#?
#pragma strict
private var isFalling = false;
public var jumpHeight = 8;
function Update ()
{
if (Input.GetKey (KeyCode.Space) && isFalling == false)
{
GetComponent.<Rigidbody>().velocity.y = jumpHeight;
isFalling = true;
}
}
function OnCollisionStay ()
{
isFalling = false;
}