Hello ewerybody, i’m trying to make a script for a game but i can not. The script should get the rotation of the object to which it refers. If the rotation is positive, another cube must do an animation.
I already tried to do a script but it doesn’t work ,maybe because I’ve just started with python:o.
The script is:
import bge
cont = bge.logic.getCurrentController()
own = cont.owner
scene = bge.logic.getCurrentScene()
cube = scene.object[“Cube”]
rot = own.worldOrientation
Use code tabs for put the code, and always open the console to see the errors of the script.
worldOrientation return a 3x3 matrix, you can’t acces to it like a euler(like the worldPosition), try using object.worldOrientation.to_euler() for change the matrix to a euler(it going to return values in radians).