0
$\begingroup$

While I was working with the actuator sensor I had a problem where it would not send a positive pulse to the controller even when the corresponding actuator was activated. Below is some terminal output produced by a python controller and a .blend file.

DEBUG:0: Actuator is False
DEBUG:1: Actuator is False
DEBUG:2: Actuator is False
DEBUG:3: Actuator is False
DEBUG:4: Keyboard.003 is True
DEBUG:5: Keyboard.003 is False
DEBUG:6: Keyboard.003 is True
DEBUG:7: Keyboard.003 is False
DEBUG:8: Keyboard.003 is True
DEBUG:9: Keyboard.003 is False
DEBUG:10: Actuator is False
DEBUG:11: Actuator is False
DEBUG:12: Actuator is False
DEBUG:13: Actuator is False
DEBUG:14: Actuator is False

This has been problematic. Why has this happening? Is it supposed too? How can I fix it.

$\endgroup$

1 Answer 1

0
$\begingroup$

There are no positive pulses on sensors. This term is a leftover from an incorrect documentation.

A sensor has two outputs:

  • an evaluation result (sensor.positive) witch is either positive or not positive and gets calculated once at each single frame
  • a trigger which marks all connected controllers to be executed on sensor execution (which happens after sensor evaluation)

The actuator sensor senses a specific actuator of the same object. It evaluates positive when the actuator is active and it evaluates not positive when the actuator is not active.

Be aware there are sensors that deactivate themselves within the same frame they got activated (such as property actuator, action actuator in property mode, motion actuator and state actuator).

Processing

t

The sensor detects the actuator is not active. As it was not active before it will evaluate not positive.

The actuator gets activated by a controller

The actuator runs and deactivates itself

t+1

The sensor detects the actuator is not active. As it was not active before (see t) it will evaluate not positive.

...

Conclusion

You can't measure that an actuator that immediately deactivates was running. You need other ways to detect this situation (e.g. by activating a property sensor that actually changes a property).

$\endgroup$
2
  • $\begingroup$ ok, that makes sense. kind of makes me question the usefulness of the actuator sensor though. thanks for the answer. $\endgroup$
    – user35690
    Commented Dec 1, 2017 at 13:30
  • $\begingroup$ The actuator sensor was introduced to allow detecting when an action actuator ends playing (to start some other operation). You can use it on a sound actuator too. $\endgroup$
    – Monster
    Commented Dec 4, 2017 at 5:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .