I am currently working on my first game. I have a modeled and weight painted character with an armature. As a test, I made two copies of said character, one with the mesh parented to the armature and one with the armature parented to the mesh. Both meshes were set to Dynamic and both armatures to Static. I created an simple action and saved it, then set up logic bricks for both characters that would play the action. The character with the armature in the mesh was affected by gravity, etc. but would play the action, and the other would play the action but hover above my ‘ground’. Help?
You parent the skin mesh object to the armature object in armature mode!
This adds you an armature modifier (keep it).
Make you skin mesh object a ghost. Otherwise it can interact with the physics of the armature.
As the armature is the parent, you can apply physics to the armature.
I recommend to keep the armature static. Better parent the armature to another object the “Physics object” (or “collision box”).
This object represents the physics mesh of the character and should be set to dynamic or rigid body. The shape can be really simple. Important is the bounding shape e.g. a sphere. The Physics object is usually invisible.
- the Physics object interacts with the environment (e.g. follows the gravity).
- The armature object performs the action to
- deform the skin mesh object
As the skin mesh object is parent ed to the armature object it follows the armature object.
As the armature object is parented to the physics object it follows the physics object (incl. the skin mesh object).
Important: Make sure the armature is parented in a way that the character seems to touch the ground. (E.g. the origin of the physics object is above the ground)
This works perfectly, except that now the charater isn’t moved by collisions at all. Th crappy enemy I made can’t push the character off the plane anymore, etc.
Is it at all possible to have the mesh be the parent and the animation still work?
The enemy must be able to interact with the physics object. (You do not even need the character for that as it is parented)
Perfect! Thank You! One little unrelated question though. I parented a camera to the character, and when I go to that view and make the charcter move in the game engine, the camera kindof goes in a circle behind the character while facing it. How do I make the camera stationary in respect to the character?
When you parent the camera to the armature (or the physics object) it should be stationary relative to the parent. No other logic is required. Maybe you have applied a camera actuator?
I don’t know exactly what was wrong, but I reparented the camera and it’s fixed now. Thanks again!