I want to call upon the particle system when my player dies as an animation, but I don’t know how to do this. It is giving me this error “The type or namespace name ‘Play’ does not exist in the namespace ‘System’ (are you missing an assembly reference?).” I want to be able to have the animation/particle system play when the player dies, how do I make that happen?
This is my code so far:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DestroyContact : MonoBehaviour {
PlayerController playerMovement;
ParticleSystem animate;
public bool dead;
void Awake()
{
playerMovement = GetComponent <PlayerController> ();
animate = GetComponent <ParticleSystem> ();
}
void Update(){
}
void OnTriggerEnter (Collider other)
{
if(other.gameObject.tag == "Floor")
{
return;
}
if(other.gameObject.tag == "Collider");
Destroy(gameObject);
PlayerDead ();
}
void PlayerDead()
{
dead = true;
playerMovement.enabled = false;
System.Play(animate); //this is where it is giving me the error
}
}