Okay, I’m getting a system set up so that the character will pick up dynamic objects, carry them to a spot, and drop them. I want some opinions on how I should do this.
Should I constrain the carried object to a location between the character’s hands?
Should I delete the original, use a ReplaceMesh to show the object being carried, and then AddObject as I let go?
Or should I instead have owned objects follow their leader? (Sort of like Yoshi eggs) (this method is undesirable yet would work for my purposes)
It’s something that should be simple with parenting to a bone. Unfortunately, parenting to a bone doesn’t work in the game engine. To be honest with you, I’d wait til it was implemented. Nothing else is going to look decent, unless you can make a walk motion where the hands don’t move much while carrying and parent to the armature. I even tried parenting to some vertices on the hand, and it didn’t work for me. I tried changing mesh with an object parented to to a hand bone and it didn’t work at all. If you get something working that looks pretty good, let us know. The only thing I can think of is to parent an objects vertices to a bone and keep it a seperate object and make it invisible, and then find the position and rotation with python and match the carried object with it every pulse. I haven’t tried it, though.
it would be easy with a ‘make parent’ actuator
i made a demo of that a while ago because somebody asked that before
Interesting script. I think he was talking about a 3rd person character carrying something rather than first person. Maybe I’m wrong. One thing that would help on a script like that is to have one text file describe how to use it and save it with that text file open. I could move around with the mouse and a little black box seemed to stay centered. Nothing else seemed to happen.
Oh, I got it to work. The wsda keys were for walk.
I do this with parent to bone as fireside said. To switch beteen things in the hand and not in the hand, I use the visibility actuator and/or IPO (to hide the collision faces).
This works with ultimate blender and looks really cool if you have a smooth animation.
Alternatively you could apply vertexgroups of the Hndbone and parent to the armature. I think this is what the monkey island demo is doing.
Monster, did you get parent to bone working in 2.41? I can’t get it to work.
After reading all this, here’s what I did.
I’ve got a system set up so that objects are held above the character’s head. The object is scripted to copy the position of an IPO’d empty which remains above the head. I’m still trying to prevent it from rotating (if anyone knows how, tell me… the method getOrientation doesn’t seem to work for me, but I may be using it wrong).
To carry multiple objects at once, I have a “store” option, in which the character takes all nearby objects and sucks them into hammerspace until they’re released.