How about this?
function Update ()
{
if (CFInput.GetKey(KeyCode.W) && transform.position.y 7)
{
rigidbody.velocity.y = speed *-1;
}
else
{
rigidbody.velocity.y = 0;
}
}
Trending Articles
More Pages to Explore .....