I have a code that’s supposed to turn a UI Image on and off when an input is held. Here’s my script…
var aimTexture : Image;
function Update() {
// Only enable aim texture when 'Aim' button is not pressed.
// In this case I have used 'Shift' key for this.
if (Input.GetButton("Aim"))
aimTexture.enabled = true;
else
aimTexture.enabled = false;
}
But, I’m not sure what to put for my variable. Like I said before, I want it to be a UI Image… What would I put?