Hello!
I have created an on-click event, where the location of the mouse click determines the rotation of the actor (to face the mouse click).
I am doing this through the Add Controller Yaw and Pitch Input nodes, as you can see in the screenshot, (for this question I am focusing just on the Yaw). I am subtracting my calculated degrees to mouse-click location (based on distance formula calculations) from my Get Actor Rotation value. Then multiplying by -1 because the result I was getting was negative, and 0.4, as it seems to be a magic number that works in my case to get the actor rotation to most closely face mouse click location (not entirely sure why 0.4).
Now, the mouse on click event is working fine, but I would like to interpolate it, to make the rotation movement smooth and not just a jump. I am trying to use the FInterp To node to interpolate between a 0 value (the default for var Interpolationzero), and the resultant value for the Yaw Input node (after the -0.4 multiplication), which does not produce the desired result.
When I set the Interp Speed to large numbers, the rotation simply snaps to the new value. When I set it to low numbers, the rotation occurs, but only to a fraction of the desired rotation angle (does not reach desired destination).
Do you have any advice on how to achieve a smooth gradual rotation from starting rotation to desired rotation calculated by the on-click event?
I am providing also a video of the on-click event in action.
Thank you very much!