Npc drawing his weapon

How to make a npc draw his weapon and keep it drawn?

let him grab a pen and play a drawing animation.

Make an animation transitioning from holstered to drawn, and then set up an Action actuator, set on “Flipper”. You could have a property named “draw” or something that, when True, activates the action. Thus, when it’s false, the action will run in reverse, effectively holstering it; however, WHILE the property is True it’ll stay on the last frame of the animation, with the weapon up.

The important part is the Flipper action actuator; the rest doesn’t really matter. It’s up to you how to approach this; there are plenty of other ways, but the Flipper action is very applicable.

Or, of course, Monster’s got it dead on XD

But can the npc keep his weapon drawn as the walking animation plays.With the method you gave me.
I just don’t want the npc weapon always drawn.


Couldn’t resist…

What i did was:
(0 had empties parented to character back and hand)
1 played animation to move hand to holster/handle/back or where ever it is resting
2 changed the weapon parented to the back (empty) of he character parent to the hand(empty)
3 played animation to reset the hand position.

Reverse case is the opposite of line 2.

In that way it doesn’t matter what animations play, the weapon is either on the back or in the hand.

Thankyou for comedy skits but I figured it out by myself.

Typically you keep some sort of state that tracks the … state of the animation. Lets call it animation state.

I suggest you grab a pen and paper and draw a graph on what animations you have and how to transit from one to another.

example:

standing -> drawing sword -> standing with sword <-> walking with sword -> “undraw” sword -> standing

and the alternative animations:
standing <-> walking with sword
standing -> drawing ball -> standing with ball <-> walking with ball -> throw ball -> standing
standing -> drawing gas -> standing with gas <-> walking with gas -> throw gas-> fall asleep

Yes, you can ‘add’ animations. (the add button on the animation actuator)
ie: a walking animation (only keyframes on the legs), a draw gun animation (only keyframes on arms), a walking-arms animation (only keyframes on arms), a walking gun-out animation (only keyframes on arms).

Combine them as necessary using two animation actuators and the ‘add’ button.