Hi can anyone help me?
I’m trying to get a cube analogic rotation on Z axis, this is my code:
import bge
cont = bge.logic.getCurrentController()
own = cont.owner
sen = cont.sensor[‘UP’]
movement = sen.axisValues
left_right = movement[0]
UP.treshold = 1000
Motion = cont.actuators[‘Motion’]
angle = own[‘angle’]
left_right = own[left_right’]
if UP.positive and angle > UP.treshold:
own[‘angle’] += left_right
Motion.dRot = ([0.0, 0.0, own[‘angle’])])
cont.activate(Motion)
Seems to be wrong, but i don’t understand where,please let me know how to solve my problem.
Thank you.