# BGE Parenting loop

I have a simple game so far. The game is not made with realistic characters, but "blocky" ones, like Blockland.

I have several objects: collision-bound object and body (torso, arms, legs, head). Everything is set to No Collision except the bound object. The bound object have WASD movements, and the body has rotation, which comes from the head (I used ml.inherit in the mousemove event).

If I make the bound object parented to the body (the head is always the parent on the body), then when the bound object move, the body won't move.

On the other hand, if I make the body parented to the bound object, the bound object will not rotate which messes up the movement (I used local coordinates).

How can I make the bound object rotate and the body to move with it?

• Hum, it's hard to figure out what you're talking about, please add an image or attach an example .blend... thx – Polosson Nov 12 '13 at 23:19
• I've been stuck here for an hour, and I don't want to give up – blackhole Nov 13 '13 at 0:49
• @TheBasicTroublemaker: Showing the logic brick setup for all relevant objects would help. These objects' relationship is clear enough from your explanation (except that the head is not the parent), but the logic controlling them is not. – Adhi Nov 13 '13 at 3:15
• @Adhi,: So you want me to attach a photo of the logic of the head, and the collision bounds. The body is just inherited rotation from the head. All the bounds has is just WSAD and [SPACE] controls. The head just has the mouselook, property hooks, and that's it. – blackhole Nov 16 '13 at 1:19
• @Adhi: You also said "except the head is not the parent," if it was the parent, then the body, arms, feet, and the collision bounds would rotate up and down with the mouselook. – blackhole Nov 16 '13 at 1:22

## 1 Answer

If I understand correctly, you want the character to move, and the head to rotate with mouse-movement?

Set up you WASD keys for the body, parent everything to that, then set up a Mouse Movement sensor, connected to a Python controller to the head. A link to the Python script is below:

http://riyuzakisan.weebly.com/mousemove-script.html

• I would have just posted the code i used, but it's super long and has copyright issues. If you can't find the script, ask me and i'll just send you my .txt file – christai Jul 17 '14 at 21:23