- Home /
Problem solved
I can't destroy a character after 117f can anyone help?
I have a group of zombies doing the Thriller dance routine and I want to destroy them at the end of the routine to make way for the next group and because it they were left to continue they would eventually go through a building.
It is destroyed at the end perfectly, the problem is with the destruction effect. Instead of playing at the end, it plays throughout the entire set.
Here is a video of what it looks like https://youtu.be/DyVYgkSyWu8 NB: while this video only shows the destruction of 1 of the zombies, I'm intending to destroy them all in the final version.
Here is the code: { public GameObject objectToDestroy; public GameObject DestructionEffect;
void Update() {
Instantiate(DestructionEffect, transform.position, transform.rotation); Destroy(objectToDestroy, 117f); //117f is the length of the dance routing plus a few extra. Debug.Log("Zombie Destroyed - Destroy Zombie"); } }
I have ontriggerenter code that is identical to this and it works perfectly fine. Does anyone have any ideas?
Follow this Question
Related Questions
Set destroy order 2 Answers
Is it possible to create a particle destroyer? 1 Answer
Collision Detection not working? 1 Answer