playMaker

Author Topic: Bug: Bool Changed doesn't fire event.[SOLVED]  (Read 2382 times)

Thore

  • Sr. Member
  • ****
  • Posts: 480
Bug: Bool Changed doesn't fire event.[SOLVED]
« 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).
« Last Edit: July 04, 2019, 04:50:02 AM by jeanfabre »

Thore

  • Sr. Member
  • ****
  • Posts: 480
Re: Bug: Bool Changed doesn't fire event.
« Reply #1 on: May 02, 2019, 07:42:54 AM »
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.

miguelfanclub

  • Full Member
  • ***
  • Posts: 165
Re: Bug: Bool Changed doesn't fire event.
« Reply #2 on: June 29, 2019, 02:35:47 PM »
Same here

bump

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Bug: Bool Changed doesn't fire event.
« Reply #3 on: July 04, 2019, 04:49:49 AM »
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