I am trying to record if my particle system
GameObject prefab = Instantiate (Prefab, myPosition, Quaternion.identity) as GameObject; Component ps = prefab.GetComponent<ParticleSystem> (); bool checkIfPSPlaying = ps.IsAlive (); //bool playing = prefab.GetComponent<ParticleSystem> ().isPlaying // This works fine
The code above gives this error:
error CS1061: Type UnityEngine.Component does not contain a definition for IsAlive and no extension method IsAlive of type UnityEngine.Component could be found
What am I doing wrong?