Alright guys, still learning my way around scripting. For this, all I need is when the left mouse button is clicked, a quick flash of a light
(from a spotlight attached to the players head) would be initiate.
var Flash : Light;
var FlashLength = 0.1;
var maxScale = 0.25;
function Update ()
{
if (Input.GetMouseButtonDown("0"))
{
LightFlashes();
}
}
function LightFlashes()
{
Flash.active = true;
yield WaitForSeconds(FlashLength);
Flash.active = false;
}
I am getting this error message “Assets/Standard Assets/Scripting/FlashOfLight.js(8,33): BCE0017: The best overload for the method ‘UnityEngine.Input.GetMouseButtonDown(int)’ is not compatible with the argument list ‘(String)’.”