playMaker

Author Topic: How to switch to another state when rotation on X is at 0?  (Read 1755 times)

Adam Z

  • Full Member
  • ***
  • Posts: 207
How to switch to another state when rotation on X is at 0?
« on: January 26, 2017, 09:53:14 PM »
I'm setting up a simple time-of-day.  I have 2 directional lights, that are facing opposite directions. One is for the sun, and the other the moon. I have 2 states; Sun and Moon.  My Direction Light rotates over time, and when it hits 0 on the X axis, I want it to go to another State. 

Right now I'm using a Float Compare, with Float One as the X rotation of the light that gets updated every frame, and Float 2 is at 0, with a tolerance of 0.1.  When the light rotates to 0 it should transition to the other state, but I get loop count error:
"Loop count exceeded maximum: 1000 Default is 1000. Override in Fsm Inspector."

What am I missing, or is there a better way to set this up? 

Thanks.
« Last Edit: January 26, 2017, 09:59:00 PM by Adam Z »

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: How to switch to another state when rotation on X is at 0?
« Reply #1 on: January 27, 2017, 08:40:17 AM »
The problem is likely that there is a certain value for X where the switch is triggered in both states.

Make sure that you can only be in one state or the other, else it will flip between the states infinitely, causing the infinite loop error

Adam Z

  • Full Member
  • ***
  • Posts: 207
Re: How to switch to another state when rotation on X is at 0?
« Reply #2 on: January 28, 2017, 11:35:36 AM »
The problem is likely that there is a certain value for X where the switch is triggered in both states.

Make sure that you can only be in one state or the other, else it will flip between the states infinitely, causing the infinite loop error
That makes sense. Thanks.