alrighty, what I’ve got right now is a flashlight that will fade out to a minimum value when the Battery Current float is <= 25% of the maximum, this works fine and is okay, but what I’m trying to do is scale the light based on that last 25%, essentially I would like to treat Battery Current at 25% as 2500 (which is the maximum brightness), and Battery Current at 0 as 250 (which is still visible but dim) those two numbers I’ve set in the clamp.
The reason I would like to set it like that is so when I scale up or down the max value, that 25% will get bigger and smaller, which in turn should fade the light out quicker or slower. right now if I were to decrease the maximum, the light would still fade even though you had 0 power, and if I were to increase the maximum it would fade before the battery was out of power.
What I did try was adding that A%B node, but that seemed to just instantly set it to the minimum as soon as the battery current was at 25%
I tried some other math stuff, but because I’m not the best at maths it didn’t work (because I didn’t know what I was working with haha)
I tried something like this (clamp(input, min_input, max_input) - min_input) / (max_input - min_input) as the input for (input * (max_output - min_output) + min_output)
but that too didn’t work.
Any help would be much appreciated.
only the bit in red is what I’m working with, and the bit in purple is what is handling that change…
Cheers.