Question by
DiabloLord · Oct 10, 2016 at 03:59 PM ·
scripting beginner
Animation only if button pressed
function Update (){ if(Input.GetButton("Vertical")) { GetComponent.().Play("walkingweapon"); } }
This is a simple animation trigger script but when i will not press the button anymore, the animation keeps on going untill i press another button. How can i make a script to animate only and ONLY when i press the button attached and when the button is not pressed it will get back to normal?
Comment