Heya there.
I’m making a goofy little Super Smash-like game and I’m wondering how I would recreate the health system found in the original game where the higher the percentage, the more knockback you’ll receive.
Heya there.
I’m making a goofy little Super Smash-like game and I’m wondering how I would recreate the health system found in the original game where the higher the percentage, the more knockback you’ll receive.
I don’t know what your knockback scripts are, so I’m just going to give you how to find the int values off of the player’s health which you can then implement into however way your knockback scripts are.
Here’s an extremely simple way of getting the integer: KnockBackUnrounded = Player’s Health / 10 & KnockBackIntensity = math.floor(KnockBackUnrounded+0.5)
With this, you should a simple and clear whole number sent back to you that you can use for whatever knockback system you want. Of course, you can always fidget around with the division, 10 just seems like a good rate out of 100.