Floor/Ceiling
Hello GS'ers,
I have a Mana Bar, and every time I use my powers, the Mana is decreased by X amount. I don't know how to put a floor limit on my Mana rule, such as when when it hits Zero, it doesn't fall below 0%. Also, when Mana isn't being used it recharges, so I need to to not go above 100%. I've tried a constrain, but that only put's it to 100 or 0. How can I accomplish this? Thank you.
I have a Mana Bar, and every time I use my powers, the Mana is decreased by X amount. I don't know how to put a floor limit on my Mana rule, such as when when it hits Zero, it doesn't fall below 0%. Also, when Mana isn't being used it recharges, so I need to to not go above 100%. I've tried a constrain, but that only put's it to 100 or 0. How can I accomplish this? Thank you.
Comments
If > than 100 change to 100
And
If < 0 change to 0.
so, if you have a timer that's increasing manna all the time, i'd do this:
if manna < 100
timer every 1 second (or whatver)
change attribute manna to manna+1 (or whatever).
so, it's only adding manna if it's less than 100. once it gets to 100, it stops.
do the same sorta thing for whatever is decreasing the manna.
I think that would work. Might be less performance draining as well.