playMaker

Author Topic: Wait Action Looping Issue (Solved)  (Read 2846 times)

magique

  • Playmaker Newbie
  • *
  • Posts: 20
    • Magique Productions, Ltd.
Wait Action Looping Issue (Solved)
« on: November 05, 2018, 08:54:12 AM »
I have a simple FSM with 2 separate Waits in it. I thought that a Wait will not go to the FINISHED transition until the Wait is completed, but in this case the second Wait, which is 3 seconds long not only completes in just 1 second, it causes the state machine to jump back to the 1 second Wait and perform the FSM tasks over again. And it's looping like this infinitely. It never gets to my last state to EnableAI.
 If I remove the first delay then the FSM works, but just not the way I want it to because I need the first 1 second delay to be timed correctly.

[EDIT]
I'm using Unity 5.6.4p3 with the latest Playmaker.
« Last Edit: November 05, 2018, 09:38:24 PM by magique »

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Wait Action Looping Issue
« Reply #1 on: November 05, 2018, 10:09:16 AM »
Hi, can we see what's in the states? It will be easier to understand where is the problem.
Available for Playmaker work

magique

  • Playmaker Newbie
  • *
  • Posts: 20
    • Magique Productions, Ltd.
Re: Wait Action Looping Issue
« Reply #2 on: November 05, 2018, 10:37:55 AM »
Sure. I'm attaching them here.

magique

  • Playmaker Newbie
  • *
  • Posts: 20
    • Magique Productions, Ltd.
Re: Wait Action Looping Issue
« Reply #3 on: November 05, 2018, 10:38:34 AM »
Final action.

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Wait Action Looping Issue
« Reply #4 on: November 05, 2018, 12:12:41 PM »
Great, i'll have a look :)
Available for Playmaker work

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Wait Action Looping Issue
« Reply #5 on: November 05, 2018, 12:16:21 PM »
Have you tried setting wait times under variables to see if the problem persists? And also try changing transition names instead of finished. I know it should work with finished everywhere, but give it a go.

Also, check if your finished event isn't marked as global by accident.
Available for Playmaker work

magique

  • Playmaker Newbie
  • *
  • Posts: 20
    • Magique Productions, Ltd.
Re: Wait Action Looping Issue
« Reply #6 on: November 05, 2018, 12:21:52 PM »
I tried setting transition names instead of using FINISHED, but that didn't work. Haven't tried variables. What do you mean by FINISHED being marked as Global? I don't see that anywhere.

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Wait Action Looping Issue
« Reply #7 on: November 05, 2018, 12:47:37 PM »
I'm not even sure that FINISHED can he marked as global event since it's built in, but i'm afk now so i can't check.

Tried saving wait times as variables?

Also, since it's a small  fsm, could you recreate it too see if it occurs again? Did you copy/ paste wait states?
Available for Playmaker work

magique

  • Playmaker Newbie
  • *
  • Posts: 20
    • Magique Productions, Ltd.
Re: Wait Action Looping Issue
« Reply #8 on: November 05, 2018, 01:02:59 PM »
No, I haven't tried saving wait times as variables. I can't test at the moment, but maybe later. No, I didn't copy and paste the states.

DanielThomas

  • Beta Group
  • Full Member
  • *
  • Posts: 150
Re: Wait Action Looping Issue
« Reply #9 on: November 05, 2018, 03:50:14 PM »
Looking at the state it's simple enough, it should wait 3 seconds. It sounds like the FSM is restarted for some reason?

What I would test, to make sure nothing else is restarting the FSM, is to create a new scene and just paste over this FSM and see if it has the same behavior (make sure it's this FSM Only). If it still has the same problem I would disable the actions in the states and only leave the Wait actions and try if that made any difference.

magique

  • Playmaker Newbie
  • *
  • Posts: 20
    • Magique Productions, Ltd.
Re: Wait Action Looping Issue
« Reply #10 on: November 05, 2018, 03:53:14 PM »
When I get back to it I'm going to try to just create it again from scratch. I think something happened to mess it up.

Thanks for all the help.

magique

  • Playmaker Newbie
  • *
  • Posts: 20
    • Magique Productions, Ltd.
Re: Wait Action Looping Issue
« Reply #11 on: November 05, 2018, 09:38:13 PM »
I started making this FSM over again and saw the really stupid error that I made. For some crazy reason I have a SpawnSkeleton state in the chain, which basically spawns the skeleton again, which causes the infinite loop. D'oh! I'm kind of embarrassed for making such a crazy blunder and I have no idea why I did it, but there it is.

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Wait Action Looping Issue (Solved)
« Reply #12 on: November 06, 2018, 02:06:23 AM »
Yeah, it's usually something like that :)
Available for Playmaker work