Playmaker Forum
Bug Reporting => PlayMaker Bug Reporting => Topic started by: Thore on April 28, 2019, 04:01:49 PM
-
Unity 2019.1.02f
Playmaker 1.9.0.p15
Oddly, none of the "changed" versions work for me, so I assume I do something wrong. I tried bool changed, int changed, and the ecosystem FSM Bool Change. I can see the variable changing in debug, but the event is never fired.
Setup
I have a plain setup with just two actions in one state, and a second state for when the Bool Changed is triggered.
1) Get Fsm Bool
2) Bool Changed
Expectation
When the first action reads the bool ("updates it"), it may not have changed since last time it read it. The Bool Changed is supposed to detect that, and trigger an event, if it did change.
What I See
Debug mode on, I can see in the Bool Changed action under "Bool Variable" that it really does change, but no event is triggered. I also see that the "Store Result" field always returns "False".
Also Tested
Tested with a normal custom event, and also tried with FINISHED. I also tried to switch the state to sequence mode, to no avail. Lastly, I also split the two actions up into each their own state (first update the bool, finished and go to second state to check if Bool Changed).
-
Okay, I believe it's borked. It seems to be a default Playmaker action, too.
Here's a quick test:
1) Make a new FSM. In START state put Bool Flip with a test bool variable, then 1s Wait, and FINISHED to next state.
2) In the next state, put just Bool Changed. Make a Changed Event and optionally, a Store Result variable. Switch debug at the bottom on. Also add a FINISHED event. Connect the Changed Event back to START, connect the FINISHED to a new, third, state.
3) Put a 1s Wait action into the third state, and FINISH lead back to the second state (previous state).
Bool Changed is however stuck in this setup. Arguably, it's also outdated, it should work like Bool Test, with two events, and every frame.
-
Same here
bump
-
Hi,
yes, it's by design. because OnEnter records the current value otherwise it would always fire a change event when the action is first executed ( on enter)
so if you send an event in a second action, it will be sent no matter what.
so do a next frame event instead of send event in the state using bool changed action if you want the same logic to work.
Bye,
Jean