- Home /
how to i increase a number temporally
so i have this script and i wana add running to it. i tried if input.getbuttondown but it not gona work like this. what do i do to get the number to go back to what it was after the button is released. pliz help me with ur genius knowledge in java coding plizzzz
Comment
Best Answer
Answer by Peter G · Dec 25, 2010 at 05:36 PM
Use Input.GetButton()
var value : float = 6.0;
function Update () { //If I recall correctly, value should snap back. other wise add another line value = 6.0;
if(Input.GetButton("Jump")) {
value = somethingElse;
}
}
Your answer
Follow this Question
Related Questions
Score that ticks up 1 Answer
RNG output to a variable + instantiating a prefab based on said variable? 1 Answer
cant register 1 Answer
How to generate unique random number 1 Answer
Empty proyect, 1700 triangles 1 Answer