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

Do something while key is pressed and held down.

$
0
0
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; }

Viewing all articles
Browse latest Browse all 8

Trending Articles



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