Quantcast
Channel: Answers for "Y Axis Limit"
Viewing all articles
Browse latest Browse all 4

Answer by christoph_r

$
0
0
How about this? function Update () { if (CFInput.GetKey(KeyCode.W) && transform.position.y <15) { rigidbody.velocity.y = speed; } else if (CFInput.GetKey(KeyCode.S) && transform.position.y > 7) { rigidbody.velocity.y = speed *-1; } else { rigidbody.velocity.y = 0; } }

Viewing all articles
Browse latest Browse all 4

Trending Articles