- Home /
Basic animation key press
So im using the mecanim to create my character controller, but im trying to activate some attack animation via simple key presses, i have this code on my character to activate a punch but it doesnt seem to be working at all. Anybody offer any help? thanks
if(Input.GetKey("k")){animation.Play("unarmed_kick2", true );//attacks
}
It seems like you havent tried learning yourself at all.
I have, I have him move-able and able to jump, but I had trouble with assigning attacks to the character, I tried to follow the steps used in the jump section to apply to my attacks but it resulted in the character perfo$$anonymous$$g an attack everytime i moved forward and not when the key was pressed
The line of code you posted is commented out with the // at the beginning. Perhaps that is why it isn't doing anything.
@Cool$$anonymous$$id808,
The code you've posted isn't for $$anonymous$$ecanim. It seems you're misunderstanding $$anonymous$$ecanim at a very basic level. As Lovrenc suggested, you really should spend some more time learning $$anonymous$$ecanim, and the difference between it and the legacy animation system.
@Dave Carlile, I posted the code wrong onto the forum, the // is not ruling out my code I ensured this, and the code that follows isnt Green either, I have decided to look closer to how the wave animation is set up, and implicating my required animations based close to this method.