- Home /
Player problem animation
Hi! I have two animations with two separate scripts. A shoot with the left mouse button and the other shoots with the right mouse button, then the animations work perfectly. When I press the mouse left and right buttons simultaneously firing animation frames that are separated as they stop the animation of both. How to solve this problem? I put two scripts.
mouse right
function Update () { if(Input.GetMouseButton(1)) { animation.Play("cannon"); } }
mouse left
function Update () { if(Input.GetMouseButton(0)) { animation.Play("miter"); } }
It really depends on what you want to do. If you press them simultaneously, are both the cannon and miter going to fire, but you only want one animation to play? It's really comes down to how you want the logic of your game to play out. Specify exactly how you want it to react and then code can be supplied for it.
When I press both mouse buttons simultaneously, the animations do not work both together, are blocked. They only work by pressing one key at a time. I ask an additional script that manages to animate the two animations simultaneously holding the two mouse buttons. Thank you.