- Home /
Question by
gilian · Jun 07, 2012 at 06:24 AM ·
javascriptcopymarble
copy position.
Hello, all. I have an empty gameObject and a sphere and i want the empty gameObject to copy the position what kinda script do i need then? Like: transform.position(x,y,z); But what do i have to do with the copy thing? Ty, already. (i'm really new to scripting)
Comment
Answer by whydoidoit · Jun 07, 2012 at 06:26 AM
Just set the transform.position on the empty game object = the sphere's
emptyGameObject.transform.position = sphere.transform.position;
Or if the script is attached to the empty game object, and you have a variable set to the sphere:
var sphere : GameObject;
...
transform.position = sphere.transform.position;