I've been trying a host of things to get this respawner to work, but either the script doesn't heed the new "debriCreate" function call after the initial spawn is destroyed as in the following case, or it tells me that the clone has already been destroyed and won't respond.
Any ideas?
var debri : GameObject;
var startSpot : Transform;
var endSpot : Transform;
private var currentDebri : GameObject;
function Start () {
debriCreate ();
}
function Update () {
if (currentDebri == false)
debriCreate ();
debriMove ();
debriDestroy ();
}
function debriMove () {
currentDebri.transform.position = Vector3.Lerp (startSpot.transform.position, endSpot.transform.position, Time.time);
currentDebri.transform.Rotate (Vector3(15, 3, 22) * Time.deltaTime);
}
function debriDestroy ()
if (currentDebri.transform.position == endSpot.position) {
Destroy (currentDebri);
}
function debriCreate () { currentDebri = Instantiate (debri, startSpot.transform.position, startSpot.transform.rotation); }