I am trying to create a game object called ‘enemy’ using the trigger function. How can I create a object I just know how to destroy a specific object ?
In the code bellow I can destroy a object but I simultaneously want to create objects at a specific place.
thank you in advance.
function OnTriggerEnter (other : Collider) {
if(other.tag == "Player"){
Destroy(gameObject.Find("door"));
Destroy(gameObject.Find("box"));
}
}