Hi Guys any help would be greatly appreciated. On my take damage function i wan to remove the armor before the health which is fine but I’m struggling to calculate if the armor is low and the damage is higher and the remainder goes over to the health as well.
First, you’ll need two variables:
float InitialDamage = damage
float PassthroughDamage = damage - CurrentShield
Then, you deal the result of a min node with InitialDamage and CurrentShield as damage to the shield. The min node is so you don’t have negative shield.
Following that, check whether PassthroughDamage is greater than 0. If it is, deal PassthroughDamage to health. You’ll likely also want to use a min node here between PassthroughDamage and Health to make sure the player doesn’t get negative health.
It would probably be best to pass the damage from the AnyDamage event into a custom event so you can use local variables rather than variables. No need to change anything if you aren't using AnyDamage.
hey @TheJtrain
@rokenrock was spot on. Just subtract the remaining armour value from the damage dealt. The remainder is what will deduct from your players health.
A simple function that checks the ar value, deducts the damage, remainder deducts from health.
Hapy coding
Stewart
Thanks guys appreciate the help.
Hey mate is there any chance you could show me a example please
Never mind all sorted thank you.