ok, i do not know if there is a build in node for that, you could recreate the calculation and make it it´s own function. in unity i made the same and it worked perfect
i am making dinner right now, be back in 30 mins ~
cheers