Blender 3D Game - Move then Rotate Object

How to write a Python Program to Blender 3D Game - Move then Rotate Object ?


Solution:

import bge

owner = bge.logic.getCurrentController().owner

z=owner.localPosition.z

if z < 5:
    owner.localPosition.z+=.1
    print(z)
else:

    owner.applyRotation([0,0,.1])


Learn More :