playMaker

Author Topic: Object watching it's own position and loop count exceeded.  (Read 2137 times)

awshima

  • Playmaker Newbie
  • *
  • Posts: 6
Object watching it's own position and loop count exceeded.
« on: April 12, 2014, 04:18:36 PM »
Hello,

I'm new to Unity, PlayMaker and FSM and I'm doing my first 2D game in order to learn.

It's another Flappy Bird clone.

I have one prefab for the pipes, and it has a FSM with a "Moving" state, that keeps watching the object position and comparing to a "Reset Position" float variable, every frame.

If the pipe's position is less than the reset position, I go to a "Reset Position" state where I move the pipe to the spawn position to the right, instead of destroying it and creating a new one.

The problem is that I'm getting this error message:

FSM : Loop count exceeded maximum: 1000 Default is 1000. Override in Fsm Inspector.

After looking some threads in this forum I'm wondering now if this is a good practice.

It looks like that I shouldn't do this, instead I should use some reset trigger object at the left of the screen and respond to a on trigger event, and then send an event to the pipe FSM.

Is that correct? Is there a better design for this scenario?

Thanks,
Alexandre

billsclass

  • Playmaker Newbie
  • *
  • Posts: 11
Re: Object watching it's own position and loop count exceeded.
« Reply #1 on: April 13, 2014, 06:53:26 PM »
It sounds to me a like you created a loop in the logic. Can you post a screenshot of the State Machine?

awshima

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Object watching it's own position and loop count exceeded.
« Reply #2 on: April 19, 2014, 12:27:39 PM »
Hello billsclass,

Here is the screenshot.

Thanks,
Alexandre

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: Object watching it's own position and loop count exceeded.
« Reply #3 on: May 17, 2014, 12:05:22 AM »
Sorry for the late response! You need to use a Next Frame Event somewhere in the loop. Break the loop down into stuff that happens in one update, then use the Next Frame Event to wait until the next update.
« Last Edit: May 17, 2014, 12:09:23 AM by Alex Chouls »