Etheri Dev Log #7: Quick note about clamping in pre attribute change
- camjhill737
- Mar 26
- 1 min read
So something I noticed is when you clamp the new value in pre attribute change whilst you do prevent your health from exceeding a threshold the actual number contained inside of new value will be the number that has exceeded your threshold. So lets say your health is at 100 and you've clamped it to 100 using new value. When you go to pick up a health potion that gives you 50 hp. New value will contain 150 and when you now take damage it will subtract from 150 value instead of subtracting from 100 like it should. Making it seem like you're now immortal in game.
A way to solve this is by calling set health or whatever attribute that needs clamping in post gameplay effect execute and inside that setter call the fmath clamp function.

Commentaires