I am trying to turn the created particle system on and off.
I attached it to the collection.
The code I use is as follows
public ParticleSystem waterGun; void Update () { if(Input.GetKey(KeyCode.W)){ waterGun.enableEmission = true; }else if(Input.GetKeyUp(KeyCode.W)){ waterGun.enableEmission = false; } }
I want the particle system to play before fps when the key is held down and stops playing when it is pressed.
source share