After further research it seems this is actually a bug, the only way to fix it is probably through an update to the engine, I’ll submit a bug report to the BGE bug tracker.
Quickly made an example blend file to see what I mean, when you press P the sphere changes rotation. What I expect is, being that the sphere is parented to the empty, the sphere to act as though it resides in the empty’s “Universe”, this works correctly in the editor, when you rotate the sphere it rotates within the empty, however once you press P and launch the game engine, the sphere no longer seems strictly bound to the empty’s borders.
If you render the image the renderer uses the same configuration as the editor. The technique is really useful, for example, for doing squash and stretch with a ball and having the ball rotate with that squash still applied, all without having to counter-animate. The game engine’s interpretation then becomes the part that seems weird in that context, by not implementing the relationship in the same way as the editor.
After some tinkering I learned some more about lattices. You can create the same effect with a caveat, the sphere becomes unrenderable in the game engine, making the small amount of excitement I experienced thinking I figured it out moot. No way to get objects affected by a lattice in-game? Hmm wonder if I can find some other solution.
Edit: After further research it seems this is actually a bug, the only way to fix it is probably through an update to the engine, I’ll submit a bug report to the BGE bug tracker.
is the empty that not have a scale as other obj , if you replace the empty with a cube(mesh) it work as expected.
anyway i see it as a bug.
all thing broken not should be visible when there the render [game engine]
i think to have found the bug,
it is in localTransform(4x4) that , make a transformation of position and orientation , but not the scale with the parent obj.
in the blend below , that make the sphere with the code should be done automatically with parent + applyRotation .afaik
(to note that worldTransform is almost new , (from 2.62) and the scale is not used pretty much in game)
Remarkable! I was trying to compile blender all day after someone told me that if I didn’t do it myself I could be waiting more than a year before someone came and fixed this bug. A whole day spent and I wasn’t able to compile the newest SVN version, let alone have time to look through a code base I don’t understand
(I had a hunch I’d find what I was looking for in the “Convert Blender Data” step as seen on this graph: http://wiki.blender.org/uploads/6/6f/Game_Engine_VisualOverview.png I don’t even know if that’s where the problem lies or not). The guys on #blendercoders were really helpful however, the only reason I couldn’t compile it is because I ran out of time.
The good news seems to be that if they don’t fix it in the code base people can use your script to bypass the problem!
#this line below should make the same thing (…i guess)
sphere.worldTransform *= mathutils.Matrix.Rotation(0.01,4,“Z”) #this work #sphere.applyRotation((0,0,0.01),1) #this not keep in count the scale of the parent obj