Quantcast
Channel: Questions in topic: "clone"
Viewing all articles
Browse latest Browse all 508

How can i Delete original Keep Clone

$
0
0
Hello there I am making a Game where you enter a Trigger the Floor will spawn in front of you and the original one AKA the Last one will destroy itself but i cant seem to destroy the last GameObject here it what I have so far PS: i am using JavaScript #pragma strict var destroyObj : boolean = false; var DuplicateObj : boolean = false; var Room1 : GameObject; var DisX : float; var DisY : float; var DisZ : float; function Start () { } function Update () { } function OnTriggerEnter (other : Collider) { if (DuplicateObj==true) { for (var i: int = 0; i < 1; i++) { Instantiate(Room1, new Vector3(i * DisX, DisY, DisZ), Quaternion.identity); } } if (destroyObj==true){ var clone = Instantiate (original, transform.position, Quaternion.identity); Destroy (clone, 1.0); } }

Viewing all articles
Browse latest Browse all 508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>