Rotation in BGE using Python

Not sure whether to put this in the BGE section, but because it is mostly Python-related I’ll put it here.

I am having problems with rotations translating into the game engine. I have made a script that should point the arms to a certain point. The idea is that I’ll use variables from another program or script and translate it towards a rotation. I have used a constraint for the bone in the arm and the rotation works, but the problems start here:

  1. The rotation will use the first input as a starting position, so when I do a 45 degrees input first it won’t use 0 as a starting point. Because of this the character can’t move his arms correctly unless I start with pressing 0 degrees first. I thought this could be fixed with changing local to world rotation, but I can’t find the correct function for it.

  2. I have a balance box on top of the arms to catch items with. I have done the except same as with the arms (except for another axis and object for constraint) but it won’t rotate ingame. When I am not in game mode it does seem to affect it.

  3. The rotations ingame seem to affect the objects in the editor too. When I leave the game mode I always see the objects rotated.


UMC_Game_2011_05_05(01).blend (1.14 MB)

Anyone have an idea?