playMaker

Author Topic: int compare[SOLVED]  (Read 1976 times)

Andys

  • Playmaker Newbie
  • *
  • Posts: 30
int compare[SOLVED]
« 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?
« Last Edit: March 27, 2013, 08:07:31 AM by jeanfabre »

greg

  • Junior Playmaker
  • **
  • Posts: 68
Re: int compare
« Reply #1 on: March 26, 2013, 02:20:20 PM »
Use "clamp" and clamp your value between 0 and 99 (every frame) :)

Andys

  • Playmaker Newbie
  • *
  • Posts: 30
Re: int compare
« Reply #2 on: March 26, 2013, 03:09:27 PM »
excellent, thanks, works perfect