unity how to clone objects code example
Example 1: how to clone something unity
public GameObject GameOjectYouWantToClone;
GameObject CloneOfGameOject = Instantiate(GameOjectYouWantToClone);
Example 2: clone gameobject unity c#
public GameObject rootObj;
void Start()
{
GameObject duplicate = Instantiate(rootObj);
}
Example 3: how to clone an object in unity at a certain position
public GameObject Bullet;
public GameObject Bomber;
void Start()
{
Bullet.transform.position = Bomber.transform.position;
(Bullet) = GameObject.Find("Bullet");
(Bomber) = GameObject.Find("Bomber");
}
void Update()
{
GameObject CloneOfGameOject = Instantiate(Bullet);
}
}
}