I’m trying to make it so the particle system is enabled whilst the player is in the trigger, but I can’t get the emission.enabled to work for me. I don’t want to turn the whole game object on and off because I want the remaining particles to finish their cycle.
Can anyone help?
using UnityEngine;
using System.Collections;
public class SparkleScript : MonoBehaviour {
public ParticleSystem Sparkle;
void Start () {
Sparkle.emission.enabled = false;
}
void OnTriggerEnter () {
Sparkle.emission.enabled = true;
}
void OnTriggerExit () {
Sparkle.emission.enabled = false;
}
}