- Home /
This post has been wikified, any user with enough reputation can edit it.
Question by
KunkkaHere · Jan 11, 2013 at 11:13 AM ·
javascriptpositiondestroyrespawnspecific
Respawning at a position when the object is destroyed.
Hello.
I have this script to destroy my cube when it enters the wrong area.
function OnTriggerEnter(other: Collider){ if (other.tag == "Player"){ Destroy(other.gameObject);
} }
I now want it to respawn at a specific position in the game, how do I do it?
I have tried diffrent things such as not destroying the object, but turning off render and then teleport it to the spawn point. However, I have not been sucessful when it comes to respawning the object.
Thank you for your time.
Comment
There's not nearly enough information here. Why can't you just 'teleport it to the spawn point' (e.g. change the transform.position)? What exactly are you trying to accomplish, and what are you seeing ins$$anonymous$$d?