playMaker

Author Topic: Exit condition [SOLVED]  (Read 206 times)

3D Lunatic

  • Playmaker Newbie
  • *
  • Posts: 16
    • View Profile
Exit condition [SOLVED]
« on: November 08, 2019, 08:33:55 AM »
I have a state for recharging mana of the player. It has a Float Add action that adds a small amount of mana Every Frame and Per Second.
Then I have a Set Bar Value action to update the Mana Bar on the UI. So far it works.
Then I have a Float Compare action that compares current mana to the maximum mana, and if maximum is reached then it exits this state. Seems logical.

During runtime, mana recharges but it doesn't stop at max. The Float Compare action is never performed. The mana simply continues increasing indefinitely.

Do you know how I can stop this loop? The Float Compare action was supposed to be my exit condition, but it's not checked.

Thanks.
« Last Edit: November 11, 2019, 01:28:08 AM by 3D Lunatic »

abend

  • Playmaker Newbie
  • *
  • Posts: 15
    • View Profile
Re: Exit condition
« Reply #1 on: November 09, 2019, 10:41:03 AM »
Is the float compare every frame?

hoyoyo80

  • Junior Playmaker
  • **
  • Posts: 86
    • View Profile
Re: Exit condition
« Reply #2 on: November 09, 2019, 06:53:15 PM »
as Abend said, check it every frame

3D Lunatic

  • Playmaker Newbie
  • *
  • Posts: 16
    • View Profile
Re: Exit condition [SOLVED]
« Reply #3 on: November 11, 2019, 01:28:23 AM »
That was the problem. Thank you!