- Home /
Question by
Molot1488 · Mar 08, 2018 at 07:43 PM ·
animation2d-platformerdeath
Animation of the death (2D Game)
I need the script that is below. Now, if enemy have 0 HP, he disappears. I need to play animation before his death. Also, when animation will be over, the enemy must remain on the last frame of the animation.
I have looking a solution for all day :\
Script
using System.Collections; using UnityEngine;
public class Weapon2DTarget : MonoBehaviour {
public void DoAction(float damage)
{
Destroy(this.gameObject);
}
}
Comment
Your answer
Follow this Question
Related Questions
Animation Parameters Not Working Correctly 0 Answers
(2D) What is the best way to implement a run-and-shoot animation? 1 Answer
Player Is Not Facing Right/Left When Root Motion Is Enabled 0 Answers
Crushing death in a plataform game using character controller 1 Answer
Randomly switch between animations (2D) 0 Answers