Have you ever been annoyed, because you can’t mix actions in the game engine?
Like you want a character running and shooting at the same time. You asked for help and the answer was: “Not possible!” ?
Believe me or not:[INDENT][INDENT]:yes: WE ALREADY HAVE ACTION MIXING :yes:
[/INDENT][/INDENT]:ba: You don’t believe me???
:evilgrin:Don’t worry
It is true. I prepared a simple demo
channelTest2.blend (425 KB)
[/INDENT][/INDENT]It was prepared and tested with Blender 2.49b.
I want to know how it works? :yes:
Ok, it is a little more complex than the classic way.
What is the classic way?
- create an action
- pose your armature
- set keyframes for the posed bones within this action
- add an action actuator to the logic bricks with the name of the action.
Need a second action?
Do the same thing but store the poses within a second action.
Add a second action actuator to play the second action.
You want to play both? Oups, no way! Just one at the time! Even with priorities just one!
But Why?
The restriction is:
- actions are played simultaneous when the actions do not share channels. A channel represent the pose for one bone.
But I want to animate all bones. That makes the character look cool ! So how to do that?
Ok here is the solution:[INDENT][INDENT][INDENT]ARMATURE CONSTRAINTS[INDENT]Ahh… What?
[/INDENT][/INDENT][/INDENT][/INDENT]Yes, armature constraints. I found them by watching a really cool rigging video tutorial. Unfortunately I didn’t bookmarked the link :o. Maybe I can post the link later.
Anyway, there should be some tutorials out in the modelling forums (I haven’t checked that). But the good news is that the constraints work within the game engine. Even the IK contraint as long it solves to bones within the armature (cool for walk cycles:yes:).
The demo uses the action constraint. But you can use other constraints as well.
You can bind a complete action to one control bone. That means when you move the control bone, the contrainted bones play the according actions dependent on the control bone’s location (or rotation). So it act as a slider or level. I think the experienced blender animators already know this an use them a lot. It makes complex animation easy to be controlled.
The point is there is ONE channel playing ALL channels of an action.
So if you want to play a second action,you need just another control bone with its action constraint.
It is a little bit complicated to add all the constraints. You need a constraint for all bones of the played action. There is a helper:
- Select the control bone,
- <shift> select the action bone
- Press <crtl>+<alt>+<c>
Blender automatically sets up some of the constraints parameters for you.
Blah blah :mad:, HOW DOES IT WORK IN GE?
Set up ONE action with ONE channel (for the first control bone).
Then set up ONE action with ONE channel (for a second control bone).
And now you can play both actions simultaneous in the game engine :spin:.
The best is, you do not even need to remake your actions. You just need to add the constraints to bind the bones to the control bone. The action constraint need the name of the original action to be played.
Enough for know! Whoever is finding spelling mistakes (I’m sure there are a lot) can keep them :D.
As usual:
I hope it helps
Monster
By the way, the Demo is really really simple. If someone has a cool rigged character with two cool ,that should be mixed together (like running with empty hands and running and holding a box) post it here. We could make a nice demo.