I'm making a first person shooter game and got the movement and the gun script to work but I created an particle system for when my enemy dies it will play, but when my character dies it doesn't play and I've tried searching and trying but none of them worked?
Code:
using UnityEngine;
public class EnemyMovement : MonoBehaviour
{
public float MaxHealth = 100;
public HealthBarScript healthBar;
public ParticleSystem EnemyDeath;
public void TakeDamage(float Amount)
{
MaxHealth -= Amount;
if (MaxHealth <= 0)
{
EnemyDeath.Play();
Die();
}
void Die()
{
Destroy(gameObject);
}
}
// Update is called once per frame
void Update()
{
}
}