- Home /
Lerpz tutorial - how to remove enemy corpses
When following the tutorial on page 80 regarding creating the CopperSpawn Game Object and positioned the Prefab, I have no problem getting new enemys to appear but it seems to leave the dead enemies where they were killed and they do not disappear. What am I missing? I've come across people who have written JS to tell the dead to vanish after a given time, say 15 seconds but I see nothing addressing this in the tutorial. After killing enemy I'm sure I have traveled outside the spawn range in order to initiate a new enemy to be created but the dead are still there.
Just looking for some direction...
-Wes
Answer by TomPendergrass · Jan 10, 2013 at 11:47 PM
I haven't done the tutorial, but you could insert this into the function that causes the enemy to die:
yield WaitForSeconds(15)
gameObject.Destroy();