I’m having a problem with setting the localPosition of an object in my game, using python, in blender 2.65a. Using “own.localPosition” seams to be acting the same way “own.worldPosition” would act. No matter what angle I have this object at it always moves along the worlds z axis, instead of the local z axis.
here’s the script I’m using (although I don’t believe this is the problem):
from bge import logic scene = logic.getCurrentScene() cont = logic.getCurrentController() own = cont.owner locZ = own ["locZ"] dip = own ["dip"] alive = own ["Alive"] motionValue = 0.01 if alive == True: if locZ <= 0.0 and locZ > -0.01: dip = True elif locZ >= -0.1 and locZ <= -0.09: dip = False if locZ <= 0 and locZ > -0.1 and dip == True: locZ -= motionValue own.localPosition -= motionValue elif locZ >= -0.1 and locZ < 0 and dip == False: locZ += motionValue own.localPosition += motionValue own ["locZ"] = locZ own ["dip"] = dip
and an example blend with the problem: localPosition.blend (416 KB)
is anyone else having this issue? Any help would be really appreciated.