playMaker

Author Topic: FINISHED event not firing problem  (Read 6226 times)

netlander

  • Playmaker Newbie
  • *
  • Posts: 13
FINISHED event not firing problem
« on: January 24, 2012, 02:58:25 PM »
Hi All,

I've noticed on a couple of occasions that the FINISHED event doesn't fire after all actions on a state have actually finished running. On these occasions I have had to resort to a Wait action on the same state before I get the FINISHED event to trigger a transition to another state.

Is this some sort of a bug? If it is then I hope it's taken into consideration by the developers, I've looked on the known issues page but there's no mention of it. It looks to me as a sort of concurrency issue where the FINISHED event sending is happening before the actions have actually finished their work and the playMaker engine just ignores the sending of the FINISHED event after all actions have resumed.

In the wait action I've tried tweaking the wait value to a small amount (like 0.1s) but that didn't help, it had to be at least 1 second. If the above is true and the wait value has to be tweaked depending on how long the actions take to finish then I guess the amount of waiting needed would be platform dependent and would be a real problem due to the fact that in testing you might have powerful hardware but when your game is out in the wild it might be run on a less savvy machine when the bug will rear its ugly head.

Could anyone from Hutong Games give some indication as to what this weird issue is about and whether a fix is in the pipeline. My concern is that the Wait action is taking up processor slots and that's a performance hit that some of us working on mobile platforms can't afford to have.

Many thanks
Paul

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: FINISHED event not firing problem
« Reply #1 on: January 24, 2012, 04:15:36 PM »
Hi Paul,

It would be great to have a small repro case where the FINISHED event doesn't fire.

Are the actions definitely finished? Remember some actions by their nature don't finish (e.g., they run every frame). Active actions have a green highlight in the editor.

Also I'll send you an invite for the 1.3 beta since that has quite a few bug fixes and performance optimizations.

Cheers,
Alex

netlander

  • Playmaker Newbie
  • *
  • Posts: 13
Re: FINISHED event not firing problem
« Reply #2 on: January 25, 2012, 11:27:46 AM »
Hey Alex,

Thanks for your reply and yes it would be great to be part of the upcoming beta.

In the meantime I have gone back to the code and replicated the error with FINISHED event not firing.

The problem occurs when I enter a state and use Add Force or Translate actions (without Every Frame option) on a GameObject the actions do take effect, I can see that in the Editor window with the transitions lighting up green, afterwards I want to use FINISHED event to move on or return to the previous state, that's when the problem occurs, the FSM stays in the current state and effectively stalls from that point on. The work around that I managed to find when I had the problem a few days ago was to use a Wait action as explained in the post above.

It's worth mentioning that in this particular scenario I have solved the problem by using iTween Move By action.

Should also mention that I am reasonably new to playMaker and it's a great tool, I love it, so it could be that I am not using it as intended...

Looking forward to the beta release.

Cheers for now
Paul

FrogP

  • Playmaker Newbie
  • *
  • Posts: 3
Re: FINISHED event not firing problem
« Reply #3 on: August 28, 2020, 07:48:38 AM »
Just to confirm the answer you're most likely looking for is to uncheck Every Frame on the "Set Animator Bool" (As an example to a state trying to use the Finished state after changing the animator bool).