So, like most python scripts I’m using ‘own’ as ‘GameLogic.getCurrentController().getOwner()’
I’m making a hand that floats in the air following the mouse and when you left click it slaps.
To do this I’m using ‘own.setPosition()’ and mouse co-ordinates, when you click it’s position is set a little bit further along the y axis and it is meant to rotate along the z axis, allthough I am stumped on how to do this.
I first tried ‘own.setRotation()’ because of setPosition(), but that didn’t work because it doesn’t exist, I then printed ‘dir(own)’ and saw ‘setOrientation()’, so I tried using that like this: ‘own.setOrientation([x,y,z])’, but got an error and now I have no idea where to go.
Was I using the right method wrongly or is there something else I should be using, and how am I meant to use it? Or do I have to use the motion actuator? (which I’d rather not).
You could use a motion actuator connected to your python controller.
Use “setDRot” to change it’s rotation. I’m not sure if this is what you’re after though.
Woot for Australian blender users. (WOOT!)
Hah, after reading that I think I will use a actuator because I’m rotating 24 degrees.
Thanks for you help, I was hoping that setOrientation was a bit simpler then that though.