Przejdź do głównej zawartości

Szukaj

need help with maths and health logic system

  • TAPgiles

    Okay, so one thing that probably won't help is... there's an output that is "remaining health (%)" which gives you the percentage of the "full health" value remaining.

    If you want to scale the health bar range based on the "full health" value in some way, the signal manipulator should do nicely. Plug in the "full health" value, and change it to "custom remapper" mode. This acts like a funnel, taking values in from the left and squeezing them or stretching them to a different range of values to output. So here, perhaps have the input range be (5 - 100) and the output range be (0.2 - 1). Then multiply that by the "remaining health (%)" and use that to power your keyframe that resizes the health bar.

    So when full health is 5 and you have 2 health left, you'd get: (0.2 * 40%). And when the full health is 100 and you have 80 health left, you'd get: (1 * 80%), something like that.

    Not sure if that made sense, but it should do what you want it to.

  • EternalDarknessz

    sorry i forgot to say im using a variable so it wouldnt conflict with the enemy health manager logic

    what you said sounds interesting ill have to check that out for other projects

    i came up with a fix tho i just needed another keyframe in the timeline at the 5hp mark to adjust where the hp bar should be at 5 hp then to scale to 0 hp.

    thanks for your reply TAPgiles

  • TAPgiles

    No worries ;D

Zaloguj się, aby dodać komentarz.