Parenting to bones


(Pooba) #1

I have my character with a run cycle and everything, and now i want her to hold something. i want it to look like she’s holding it, sowhen she moves her hand it moves with it. My character uses armatures, so i figure i can just parent it to the hand bone. it looks fine in the blender window and works, but when i go into the gameengine the object moves in front of the character and stays there. It moves, but like i would have parented it to the empty.

Can you not parent stuff to bones in the gameengine?

Pooba


(saluk) #2

Nope, gameengine has no bone parenting. There are two ways to accomplish what you want. Parent the object to the armature and set up the vertices to be attached to that bone the normal way. If you need to have her pick up the object, you can set up an ipo where on frame 1 the scale is normal size, but on frame 2 set the scale so the object is infinitely small. THen you can just play the ipo one way or the other to “create” or “remove” the object from her hand.

Another way to do it, which isn’t so good, is to use that bone parenting animation, and step through the animation adding a loc ipo at each frame. Then just make the object play its ipo at the same time the armature is playing its action. But sometimes with this way the animations can get out of sync.


(Pooba) #3

Thanx saluk!

The only problem with the first one is that the object’s center doesn’t go with the vertices. I want the object to be able to add an object. The second one sounds like it would work best.

Thanx again!

Pooba


(blendedHKU) #4

if would suggest you use the ‘scale armature’ trick described above, so your character can hold weapons.

then to add someting on the right position, for example a bullet leaving a gun do the following.

place the bullet in the gun (on the position you want to add it), place an empty on the position of the character object , then parent the bullet to the empty, and add the empty.

then when you shoot you add an empty,which adds the parented bullet in the barrel of the gun.
then delete the empty object with an end actuator, because we don’t need it anymore.

Make sure the bullet has a movement sensor so it flies :slight_smile: