playMaker

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

3D Lunatic

  • Playmaker Newbie
  • *
  • Posts: 17
Exit condition [SOLVED]
« on: November 08, 2019, 10: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, 03:28:08 AM by 3D Lunatic »

abend

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Exit condition
« Reply #1 on: November 09, 2019, 12:41:03 PM »
Is the float compare every frame?

hoyoyo80

  • Full Member
  • ***
  • Posts: 125
Re: Exit condition
« Reply #2 on: November 09, 2019, 08:53:15 PM »
as Abend said, check it every frame

3D Lunatic

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