Quantcast
Channel: Questions in topic: "held down"
Viewing all articles
Browse latest Browse all 8

Delay light on held down button

$
0
0
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! :)

Viewing all articles
Browse latest Browse all 8

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>