hello,i’m kinda bad at scripting but so far this is one of my best scripts i put together and its just this one last step that isn’t working for me and that’s the input functions i’m having a hard time getting the muzzle flash to work when i press the left mouse key instead the muzzle flash works when i press any button on my keyboard i have tried to switch the inputs around and i still cant get it to work i’m pretty sure this is a simply fix i just need help so can someone please help me,thanks here’s my script
#pragma strict
var muzzleFlash : ParticleEmitter;
var lightone : GameObject;
var lighttwo : GameObject;
var lightthree : GameObject;
function Start() {
muzzleFlash.emit = false;
}
function Update () {
if(!Input.GetKeyDown(KeyCode.Mouse0))
{
muzzleFlash.emit = true;
lightone.active = true;
lighttwo.active = true;
lightthree.active = true;
}
if(Input.anyKey == false)
{
muzzleFlash.emit = false;
lightone.active = false;
lighttwo.active = false;
lightthree.active = false;
}
}