Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: 3D Lunatic on November 08, 2019, 10:33:55 AM

Title: Exit condition [SOLVED]
Post by: 3D Lunatic 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.
Title: Re: Exit condition
Post by: abend on November 09, 2019, 12:41:03 PM
Is the float compare every frame?
Title: Re: Exit condition
Post by: hoyoyo80 on November 09, 2019, 08:53:15 PM
as Abend said, check it every frame
Title: Re: Exit condition [SOLVED]
Post by: 3D Lunatic on November 11, 2019, 03:28:23 AM
That was the problem. Thank you!