Bugs with rig and animations priorities

I have a bug where the character in my games head will snap when he is looking forwards is there any way to fix it without going through all the animations and make sure that the rotation of the head bone isn’t enough to trigger the bug? (The bug doesn’t appear on the other layer where have a copy of the player to make new animations on?)

And another bug I have is with priorities of the animation (I think) The player doesnt play the animations when told. Is it the lower the number the more priority the animations has?

I have Walk, Idle and Cover on priority 3 and and the CoverPeak left and right on 2?

Bugs @ 1:20

I use python and conditions to play animations but you can do that yourself using logic as well, it just gets complicated fast.

If not pressing any keys and on ground-play idle

If W is pressed and not shift—play run

Make sure they are all on different layers, (your animations)

You can see what animations are playing by using the actuator sensor.

I think* the lower number layer has higher priority and without a blend file I can only advice you to double check every keyframes in the animation, on top of that you can try to use track to constraint to direct the character head/eyes/etc movement, blending the canned animation with it maybe?

your character and game looks interesting

Yes, the lower the priority-number is the higher will blender prioritize the animation.
If two animations have the same priority the armature can freeze.If you want animations two “eliminate each other” you can always have an “explaination controller” and type in the sensors and the “=true/false value” to prevent this from happening.

Try to set the “idle-animation” to something higher than the other animations. (I usually set it to 100 to give me more space to work with the other actions)

If needed check the three dots pointing upwards on the always actuator for the “idle animation” to make it play at every frame when there is no other animation playing. (Sometimes this have to be done to make the animation return to the idle animation after playing another animation)

If you want the “cover-animation” to “overlap” the “walk-animation” then the “cover-animation” should have a lower prioritynumber than the “walk-animation”.

The head snapping…
I dont know what is causing this, it could be a bug. Though this can happen if the head-bone do have an constraint that is following another object, this could be for example an child-constraint - I dont know how to solve this.

It is not very easy to explain this, hope you understand it and that it will help you!
The game character looks really nice tho:) keep it up!

If you continually play idle etc it can soak up a bunch of resources,

Animation uses the most cpu time out of anything I have encountered in bge.

Yes you are probably right, but are there any options?

So I fixed the head snapping! If you have a limit rotation constraint on your rig then it seems make it snap, it can be fixed by setting it from world space to pose space. Just gotta mess with the priorities and I should be sweet thanks guys

EDIT: I’ve fixed the animations being stuck once leaving cover by using KX_ACTION_MODE_PLAY for the CoverPeak animations instead of KX_ACTION_MODE_LOOP that im using for the walk, idle and cover, it seems the priorities were right after all :slight_smile:

you can activate / deactivate actions using python

check out gamelogic simple in templates in the blender text editor