2
$\begingroup$

(Please refer to the attached picture.) I set up a very simple Blender Game Engine demo as follows:

  1. Attach an always sensor to the default cube.
  2. Attach a motion actuator to the cube.
  3. Set the motion to rotate 1 degree about z-axis.
  4. Add a game property: integer variable 'tick' (initial value=0)
  5. Enable the debug info of the property.
  6. Attach a property actuator to the cube.
  7. Set the actuator to increment 'tick' by 1.
  8. Wire both actuators to the same controller.

Now I can play with the demo. Trying various combinations of the parameters of the always sensor (activate true, false, level, tap, invert, freq, ...); I can see the cube rotates and 'tick' updates continuously or once only.

What puzzle me is, by using the defaults, the cube rotates continuously while the tick increase once only. How come when BOTH actuators are connected to the SAME controller, yet the motion actuator get triggered steadily while property get triggered once only?

Can anyone please explain? enter image description here

$\endgroup$

1 Answer 1

2
$\begingroup$

The problem is that the Always sensor is going True and staying there. This works fine for the Motion actuator which will continue to do whatever you want it to as long as its input is True. This doesn't work however for the Property actuator. It only gets triggered when ever the input goes from False to True. This can be seen by hooking up a keyboard sensor to it instead. If you set it to a key and hold that key, the motion will happen continuously, while the property will only have one added to it when the key is first pressed. To get around this you need to set the Always sensor to True level triggering, which means that it will go False then True then False and so forth at the pace defined by the Freq slider.

enter image description here

$\endgroup$
3
  • $\begingroup$ so one is level triggered and the second is edge triggered ? $\endgroup$
    – Chebhou
    Mar 2, 2015 at 18:29
  • $\begingroup$ I updated my answer, see if that makes more sense @Chebhou $\endgroup$ Mar 2, 2015 at 18:52
  • $\begingroup$ no problem @ShungChing $\endgroup$ Mar 3, 2015 at 2:23

You must log in to answer this question.

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