Hello beautiful answering community!
Once again, could be a noob question from a beginner in coding, but I'm trying to program a fireball to appead when the right mouse button is held down. I managed to do that, and when the right mouse button is held, the particle emitter and light source appear.
However how would I script the light to be delayed a few seconds? (The light has a different script to the flames) This is the script for the light:
function Start () {
light.enabled = false;
}
function Update() {
if(Input.GetMouseButtonDown (1))
light.enabled = true;
else if (Input.GetMouseButtonUp (1))
light.enabled = false;
}
Thanks in advance for your help! :)
↧