Triplanar mapping from Local Space - problem when scaling. How to make it work?

Here we are two years later. Is there a version of this code that works with UE 5.2 and up. some of the inputs are changed now