Help writing function to instantly rotate third person character to face thumbstick direction

After a lot of experimenting I’ve come up with a function that seems to work fine so far, posted above. Thanks again.