Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

how to move a gameobject to another object

//Attach this to the oject you want to move
public GameObject Bullet
public GameObject Cannon

void Start()
{
 (Bullet) = GameObject.Find("Bullet"); //These are to find the object to move to
 (Cannon) = GameObject.Find("Cannon"); 
 Bullet.transform.position = Cannon.transform.position; //this is to move the object
}
 
PREVIOUS NEXT
Tagged: #move #gameobject #object
ADD COMMENT
Topic
Name
1+1 =