Animations in the game engine

Hi, I am new so I am having a bit of trouble in blender. The thing is I have a basic, rigged human, and a cylinder that is parented to one of the bones using a child of constraint. When I play animations the cylinder follows the bone normally, but when I try to play them in the game engine the cylinder stops following the bone. How do I fix this?

pickup_animation.blend (798 KB)

Attachments

pickup_animation.blend (799 KB)

can be that this constraint not work in BGE , as many other (maybe some advice as a line red that mena : not work in BGE should be usefull, when there the render [game engine] selected)

The ManCandy armature is just a demo (ManCandy was designed for Blender not for BGE). No need to rebuild the armature design ;).

You can use any armature you like.
Indeed the guide does not tell you what features are supported (or not) by the BGE. It describes a general setup with common armatures.

You should not transform the mesh.

Use the Armature Object for Pose-animations (deform).
Use the Physics Object to interact with the scene (motion).

The Skin Mesh Objects and Bone Hooks will follow the armature animations and the physics motion.

(see section: Skin first paragraph)

I am having issues here as well, I just did not relise I needed a skin modifier ! :slight_smile:

So I can’t animate with skeletal animation in game?

I don’t get it… I have the armature bound to a block that is dynamic, I have the empty that the Armature is targeting as a seperate dynamic object, the rig deforms in the window, but not in the BGE, it just turns solid…

Here is my can O worms!

Attachments

Worm2.blend (459 KB)

The armature alone does nothing

you need to activate one or more action actuators
or
you activate an armature actuator (something you need for IK outside of the armature)

could you make a super simple.blend?

just add:

always --> AND --> Armature Actuator

Think you kind mister monster, and enjoy your awesomeness… :slight_smile:

but it says to in the guide “Apply any transformation on the Skin Mesh Object (pos/rot/scale). You can do that with <ctrl-A>”

okay then, what do I apply them to? And what’s a Physics objects and a bone hook? Also, I don’t really get the difference between Pose-animation and motion. What kind of interaction with the scene do you mean? Sorry, but I am very new to all of these.

This is a general advice when working with skin meshes (even without the BGE).
One of the common issues is that you model you skin mesh but you do not look where the origin is.
Then you move/rotate/scale the whole object (in object mode) that it fits the armature.

The result might be that your mesh is still rotated 90° around some axes. As you rotated in object mode you do not see that in 3D view.
If you do <alt+R> the orientation (Object mode) will be reset and your model will look very bad.

To avoid that better apply the rotation BEFORE you rig the skin mesh.

This belongs to location. Match the origin of the armature. I recommend to keep both at the scene origin (0,0,0). That makes work much easier.

This belongs the scale as well.

Beside easier workflow, there can be other unwanted effects, if the mesh object does not have reset transformations.

Hint: the skin mesh object [edit] and the armature (before connecting)[/edit] should have these transformations:

Location 

0.0, 0.0, 0.0


Rotation 

0.0, 0.0, 0.0


Scale 
1.0, 1.0, 1.0

Please have a look at the guide it is described there

Pose animation is what you setup when you animate the armature in pose mode = bone animation

Motion animation is when you move/rotate/scale a complete object (e.g. the armature, not the bone) this is also called object action.

I do not know if there is an agreement how to call this things. If someone knows it would be nice to post a reference :).

Motion/rotation/scaling of an object changes the scene as all objects are part of the scene = interaction ;). This is what is usually called run, turn, jump etc…

While the pose action performs the walkcycle is an pose animation in place = the object does not move around. It just moves the arms and legs.

When you combine motion animation + pose animation it looks like the character is walking. That is the whole trick.

i test it , the constraint “child of” not work.(note that the constraint from a mesh very few work)
to replace this, no problem
use “normal parent” :
[select chilindre -> properties -> object -> relation -> parent(select armature obj of character) -> type armature -> bone(select bone)]
or CTRL+P -> bone
…and delete the constraint

Here’s a simple character setup .blend based on the BGE Guide to Character Setup:

CharacterSetup.blend (1.22 MB)

Umm, something weird happened. I added an empty to act as a bone hook, but now there is a field around the empty that applies any transformations done in it to everything else in the field. Why?

Edit: Also, when I parent it do a bone it works fine when it’s not in the game engine, but messes up when it is.

I think you accidentally switched on proportional edit (<O>). Switch it off by pressing <O> again (you see it at the button bar left of snapping)

If you bone hook does not what you expect make sure there is no scale on the armature (and it 's parents). Unparent and parent again.
In a lot of cases this fixes any issue.

I’m not sure why there would be a field around the empty. Does it apply transformations to objects that are children of the empty only if they are in the field or does it apply transformations to all objects in the field regardless of whether they are a child of the empty or not? Does it show the field around the empty in the 3D View? Maybe you could post a screen-shot or a blend of the issue.

Just to make sure, are you selecting the empty, then selecting the bone you want in pose mode, then choosing “Bone” from the Parent To: drop-down menu after pressing CTRL-P? Like Monster said, it is very important to reset the scale and rotation of the armature and any object you wish to create a parent relationship with before you perform the parenting.

One reason why it may work in the 3D View but not in the game engine is that the empty (and every child of it) is not set to “No Collision” for the Physics Type.

THANK YOU SO MUCH MONSTER! It’s working great now, and I can continue on with my program. You helped a lot man, thanks.

I still have riggin issues, can you check out my thread monster? I have an armature rigged, but not running, and this time I actually have always-Run-armature