- Home /
How to implement animation on trigger/without?
Hello!
Iam pretty new to making games and such and I ran into o' so many problems, this is one of them and the tutorial script would not work, its a phsyics "mover" game and when the player runs to a laser, he is destroyed. from now on I would like to make a death animation, an explosion of some sort and I do not know how to implement the animation in place of the destroyed player.
I can guess the animation comes befor the player is destroyed since it would have to be linked to the player and that would not do if he is destroyed, or would it?
I have searched for days but while its a very common question (from what I can tell) nothing has been helpful one bit
Any help would be really apriciated! :D Thank you
Answer by Andrea_Marchetti · Jul 19, 2017 at 07:28 PM
If you want to use a particle system to simulate the explosion then:
Make a prefab of a GameObject with a particle system attached.
Edit your particle system to make it looks like an explosion.
Reference your prefab to your script through the editor.
Call: Instantiate (explosion_prefab); when you need it.
Set the position of the gameObject to be the same of your player.
You can destroy your player object.