We created a script for our main character (Vlad the Bear), and it links keyboard input to animations we have made in Blender. It goes as follows:
Okay, so when we play it, the animations play for the walking around. However the animation for attacking only plays when the spacebar is held. Is there any way to go about the scripting for the attack as to play the animation fully when the spacebar is tapped, and to return to the moving scripting/animations?
Also is there an absolute value code? I would like to make the bear be able to move forward and turn sideways, but not to be able to walk backwards as it looks unnatural with our current aniamtions.
Thank you !
First, for the jump you can use
This fires only once when the key is pressed, then will be checked only after the key has been released and pressed again, so it's good for one-time actions.
For the absolute value you can use:
Please seperate your questions next time though. Hope it works :)
answered Apr 01 '11 at 10:45 PM