I am sorry for this nooby question, and I have seen similar questions on the forum, but none of the solutions are working for me. Basically what I am trying to do is while the Fire1 key is pressed, and held down I want to increase the value of testNumber by 1 continuously. Currently when I run this script I press the Fire1 button and hold it down, but the value doesnt continuously keep increasing, it will only increase again if i let go and repress the button. Any help would be really appreciated. Thanks
var testNumber : int = 0;
var testText : GUIText;
function Start () {
}
function Update () {
if(Input.GetButtonDown("Fire1"))
{
testNumber += 1;
}
testText.text = "" + testNumber;
}
↧