Hi,
I have a particle system put into the hierarchy of the game object and I want to trigger it using an event set on the animation clip(fbx file with a sword attack). The script has no errors until I activate the animation in the build. I get this error and I have no idea how to solve it:
"
NullReferenceException: Object reference not set to an instance of an object
ParticleEvents.StartAttack01 () (at Assets/ParticleEvents.cs:22)
"
I have a simple script attached to the game object containing the character and the particle system. What more am I suppose to add? I did name the events attached to the animation using the same naming convention as lower.
public class ParticleEvents : MonoBehaviour
{
ParticleSystem SwordSlash_EFF;
void Start()
{
}
void Update()
{
}
public void StartAttack01()
{
SwordSlash_EFF.Play();
}
public void EndAttack01()
{
SwordSlash_EFF.Stop();
}
}
Thank you!