Yes, I'm a pest. But, addActiveActuator?

I’ve gone through great lengths to write a script that comes up with a certain number of degrees of rotation. After going through all the different possibilities I’m going to try using the motion actuator to rotate my object(locally) that certain number of degrees. At the moment my script rotates the object at very high speeds once the script is triggered, even if the sensor is set to only fire once. The script uses GameLogic.addActiveActuator(rotateActuator , 1)
I tried placing GameLogic.addActiveActuator(rotateActuator, 0)
directly after the first statement to see if it would rotate just once, but it still rolls on, when I run it. Is this the only way to control Actuators from python :smiley: ?
I’m going to try triggering two property actuators (one true one false) that will trigger a property sensor that then triggers the rotation.

yes that is the only way of triggering actuators from python, so the problem lies with your actuator

use dRot instead or angluar velocity (I forget…)

or, much easier, use an ipo actuator, and a property.

You need to addActiveActuator(rotateActuator, 0) on the next frame after you activated it. Trying to activate it and deactivate it on the same frame doesn’t work.

thanks :slight_smile:

Yep its very important to know where python fits in in the engine’s execution. As far as I can tell, this is the order of operations:

Scene rendered
Sensors tested
All python scripts are run (even if they span multiple objects)
Actuators are run
Physics execute

So you can’t do things like setting an object to multiple positions on a frame, as the only position that will matter is the last position it was set to.