Question by
Crossroad1000 · Nov 29, 2015 at 10:14 PM ·
positionvector3transportonly
Transport only Z position
Hi, I need a little help. This is my script:
this.transform.Translate(new Vector3(0, 0, 70));
Right now it wil transport the object with +70. But how do I position the Z-position without transport the X&Y.
this.transform.position = Vector3(0, 0, 70);
This is what I want but right now the X and Y position are also changing.
Comment
Answer by OncaLupe · Nov 29, 2015 at 11:36 PM
Try this:
transform.position = new Vector3(transform.position.x, transform.position.y, 70);
Your answer
Follow this Question
Related Questions
Click Vector3 position to change color 0 Answers
How to sync position using new unity transport? 1 Answer
prob to define a condition to get out of a search position loop for obstacle avoidance 0 Answers
Player Floating 0 Answers
A position behind a moving gamobject but still inside another gameobject 0 Answers