- Home /
Question by
Srimasis · Feb 04, 2013 at 05:02 PM ·
gameobjecttransform
how can i move another gameobject from a single script?
should i use GameObject.Find("objectname").transform.position = vector3(x,y,z); . Thanks..
Comment
Answer by robertbu · Feb 04, 2013 at 05:12 PM
What you have works. GameObject.Find() is expensive operation, so you don't want to do it every frame. Typically it is called during initialization inside Start() and the value is saved inside the script for later use. Look here for more information on accessing other game objects: