- Home /
Moving multiple objects(same objects) in different directions
So I have one object, that is instantiated into a circle shape.
I'm trying to make it so each of those child objects are sent in each their own direction.
How would I go by as to do this? Since using something like
transform.position += new Vector3 (0.0f, 10.0f * Time.deltaTime, 0.0f);
Causes all the objects to fly in a single direction.
Comment
Answer by VesuvianPrime · Feb 10, 2015 at 02:37 AM
You could add a field:
public Vector3 origin;
And have your objects move away from this origin:
Vector3 direction = (transform.position - origin).normalized;
transform.position += direction * Time.deltaTime * 10.0f;
THAT FREA$$anonymous$$ING WOR$$anonymous$$ED!!
Thanks!
So it seems like I can't move the center object without causing the other objects to start going crazy..
Your answer
![](https://koobas.hobune.stream/wayback/20220613182928im_/https://answers.unity.com/themes/thub/images/avi.jpg)