I want to use the end of an action as input for my state machine, therefore I need a way to trigger a sensor as soon as the current action stops. How would you realize this? My attempts so far have all failed
the actuator sensor does not work for “Loop Stop”-Mode of the Action actuator. Other modes don’t work for me (animation must be interruptable and playable multiple times).
a property sensor checking the current frame of the action actuator is not realiably working, because its only applicable mode is “interval”. But of course an action of length 37.0 never restarts exactly at 37.0 but at 36.94 or 36.99…so the sensor won’t catch these cases.
Of course I could use an “always”-Sensor and then trigger as soon as the current frame of the action actuator switches from a higher to a lower value. But I wonder if there is a more elegant solution to this problem. Any ideas?
Since 2.62 there are some bugs with the action actuator. Only the play mode seems to process as expected. One of the bugs prevents to deactivate the running ActionActuators on state change form time to time. This is really annoying.
If you use Loop modes the actuator will never deactivate itself … as it runs in a loop ;). This sounds logical but I hit the same trap.
You can use an integer property to check the frame for discrete values. As you (still) can’t enter a different speed all natural numbers should hit during play.
Another option is the interval as you already know.
or
The often under-estimated expression controller.
I use that to get the current frame as an integer. It works great for the RPG that I am working on, where I want damage to be calculated at a certain point during the animation.