Motion acutator question

I have a newbie question. I’d like to do a simulation of a simple robot, letting the user’s input via keyboard/mouse etc. set the position and orientation of a joint of the robot. I can see that using the motion actuator allows me to change either the velocity or delta position/orientation, but I’d like to set the position/orientation itself.

So far, I noticed that using the constraint actuator allows me to set the position by picking max and min to be the same and using three constraints, once each for x, y, and z. For orientation, I could imagine writing a Python script to keep track of the current orientation the use dRot to move to the desired orientation, but that seems a little kludgy. Does anyone know a better way?


You can do this with python.

“owner.getPosition()” would return a list of 3 variables presenting the objects current location [x,y,z]. You can use this to keep track of the objects location.

You can use “owner.setPosition()” to set the location of an object.

“owner.getOrientation()” would return a 3x3 orientation matrix, which you can use to keep track of the objects orientation.

Using “owner.setOrientation()” you can set the rotation of an object with the same 3x3 matrix structure.

Thanks! That’s exactly what I was hoping for. I appreciate the help.