- Home /
Why to set maximum and minimum for transform.position of an object in javascript?
if (Input.GetKey (KeyCode.UpArrow)) { transform.position.z += 0.1; } if (Input.GetKey (KeyCode.DownArrow)) { transform.position.z -= 0.1; }
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613143100im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How do I make one transform rotation the same as anothers? 2 Answers
Objects with same position appear in different places 2 Answers
Offset against Rotated Object,Applying Offset to a Rotated Transform 1 Answer
GameObject won't move to Transform Position 0 Answers
How to make object stay certain distance above ground (relative o ground normal) 1 Answer