Question by
igorbebkiewicz · Jun 22, 2016 at 12:57 PM ·
unity 5vector3
How to move object to the right?
Hi! I'm looking for some small solution for move object to the right when OnTriggerEnter. Now I have that:
Vector3 position = new Vector3(Random.Range(0,60.0F), 1, Random.Range(0,60.0F));
Instantiate (Diamond, position, Quaternion.identity);
But that gives me position starts from the left when I want locate my object 10f further to the right from current location for example.
Comment
Best Answer
Answer by SarperS · Jun 22, 2016 at 01:01 PM
Vector3 offset = new Vector3(10f, 0, 0);
Vector3 position = new Vector3(Random.Range(0,60.0F), 1, Random.Range(0,60.0F));
Instantiate (Diamond, offset + position, Quaternion.identity);
Your answer
Follow this Question
Related Questions
Stupid question but I have to figure out 0 Answers
iron sight using inverse kinematic 0 Answers
How to get the angle to animate the player when running? 0 Answers
Unity transform.forward issue 1 Answer