Hello,i would like to enable the emission of a particle effect for as long as i m pressing the key.I attached the script below to the particle system and i unchecked ‘‘Play on awake’’.Whenever i press Shift nothing is happening.If i check ‘‘Play on awake’’ the emission will start on its own and stop when i press shift.Once it has stopped,i can enable the emission by pressing Shift whenever i want.This way it is working as intended except of playing on awake,i don’t want it to play on awake.What am i doing wrong? ![]()
using UnityEngine;
using System.Collections;
public class Particlesonkeypres : MonoBehaviour {
public ParticleSystem Particletest;
void Update () {
if(Input.GetKey(KeyCode.LeftShift)){
Particletest.enableEmission = true;
}else if(Input.GetKeyUp(KeyCode.LeftShift)){
Particletest.enableEmission = false;
}
}
}