how to make an animation to play when a int has a certain value, and pressing space key?
i'm trying to do that, but its not working, heres the code: void Update() { if (Input.GetKeyDown("space") && (IDdaArma == 0)) { animation.Play("ArmaPadraoAtirando"); } } }
looks like the void update is ignoring what i did in the "if" code, and only does the animation code thing. the animation keeps repeating if i keep the loop time option turned on, if i turn it off the animation only plays at the start of the scene and never plays again. i want to a certain animation file plays when the value of the int (IDdaArma) is 0, and if the value is 1, another animation file plays when pressing space.
Comment