how can i move another gameobject from a single script?

should i use GameObject.Find(“objectname”).transform.position = vector3(x,y,z); . Thanks…

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:

Accessing Other Game Objects