system
February 3, 2011, 4:42am
1
Really basic question (Im kind of embarrassed), but when you want to move something to another position (using this bit of code),
transform.position = Vector3(0, 0, 0);
Instead of "Vector3(whatever)", how can you have the position be that of another object?
Thanks
tertle
February 3, 2011, 5:19am
2
transform.position = otherobject.transform.position;
To get a reference to otherobject, there is a good article in the scripting reference
Overview: Accessing Other Game Objects
Note you shouldn't do do a find every update (might start impacting performance badly if you have too many objects), but instead get a reference to it once and store it.