Parent a sword to a bone

hi all, i’ve got a problem…
I’m making a roleplaying game, and i have 2 armature: one for the pg and one for the sword. I need to parent the sword armature to the hand-bone of the pg, how can i do that? i tryed to do the parent to bone in the blender enviroment, but it doesn’t work in the GE.
thanks in advance.

I think in 2.5x the game engine doesn’t support parenting objects to bones.

Two options:

  1. Use only one armature and use vertex groups. (the way it should be done)
  2. Use a python script to get the loc, scale, rot of the bone, transform these to global values and apply them to the object. (poor performance, lot of math and python/bge-api knowledge needed)

Hello
as most things in GE, you can get the same result by different ways!
Some “brainstorming” is needed first, that will lend to some particular technique, ex:
Will the character always hold the sword?
Anyway, one easy method is to give the sword a “Vertex Group” with the same name as the hand’s bone and then parent the sword to the Armature ( delete sword’s Armature).
Bye

@Cody- I’m not sure where you got the idea that parenting to bone doesn’t work in 2.5x- it works just fine. That’s probably the best option, since that way you can still get correct collisions with the sword (if you animate it with vertex groups the collisions won’t update right)

@captain can you explane me how can i parent the sword to the bone?

the sword need the armature because it’s a scissor-sword…if the parent don’t work i’ll go with script

in pose mode of the armature, first select the sword, the the bone of the armature you want to parent it to. the armature has to be in pose mode!

it doesn’t work in the game engine…

Maybe you should post a blend with the problem, it works in the game engine every time I try it.

now it work… there a way to cange the parent bone in the game engine? because when the sword is not in the hand it must be child of the back-bone

Are you having issues parenting in real-time? If so, bone parent an empty and then parent the sword to the empty.