Using properties as motion speed values?

Is there any way to use the value of a property as the speed for a motion?

yes, it is.

You transfer the property value via Python code to the desired attribute.

Example (very quick and very dirty):


def propertyLinVXToLinV0(controller):   
   owner = controller.owner
   motionActuator = controller.actuator[0]
   motionActuator.linV[0] = owner["linVX"]
   controller.activate(motionActuator)

usage:
any sensor --> Python Module: <moduleNameWithoutPy>.propertyLinVXToLinV0
or with multiple properties:


def propertiesLinVToLinV(controller):   
   owner = controller.owner
   motionActuator = controller.actuator[0]
   motionActuator.linV[0] = owner["linVX"]
   motionActuator.linV[1] = owner["linVY"]
   motionActuator.linV[2] = owner["linVZ"]
   controller.activate(motionActuator)

any sensor --> Python Module: <moduleNameWithoutPy>.propertiesLinVToLinV

yes here is a example .blend

Attachments

Example5.6.2013.blend (412 KB)

Thank you. Marking the thread as [Solved]