Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Andys on March 26, 2013, 12:04:14 PM

Title: int compare[SOLVED]
Post by: Andys on March 26, 2013, 12:04:14 PM
I have my health system working with out problem, and I've added a health Regen FSM which also works fine until you get to max health with in my case is 99, after that the ReGen just keeps adding.

So i added a Int compare to the Regen FSM, which is ok until it gets to 98, then the game hangs for a couple of seconds, then the last number is added to make 99, after that, it will not restart when health drops below 99, have i got this wrong?
Title: Re: int compare
Post by: greg on March 26, 2013, 02:20:20 PM
Use "clamp" and clamp your value between 0 and 99 (every frame) :)
Title: Re: int compare
Post by: Andys on March 26, 2013, 03:09:27 PM
excellent, thanks, works perfect