Download

Rotator fluctuates between positive and negative during easing function.

I am simulating animation by interping a mesh. Using a timeline and an Ease function, I feed in rotation variables (start and end, just the yaw axis). I want this to flip if the player character switches to the other side of their target. To do this, I multiply the yaw value (as a float) by -1. This happens in the InvertValues function, and happens dynamically whilst I am Easing my rotator.

LerpWeapon_2.png

However, when I am doing this on one side, the values fluctuate between positive and negative and a get an interpolation which starts at either end before meeting in the middle. You can see the rotation values in the log below. Like I said, it functions perfectly on one side, but not on the other.

LerpWeapon_3.png

Any idea what might be calling this? Is there some limitation or principle to using the Ease function that I’m not understanding? Any suggestions would be greatly appreciated.

First: The Rotations are in a range from -180 to 180 and not 0-360.
Second: Your Invert Function is called every Timeline tick, thus it gets inverted by every interpolation step. You need to calculate the Start and End ONCE and not every tick.

Thanks for your answer. I realised that my Invert function was forcing the Current Mesh Rotation to swap and then set every tick, which was why I was seeing the weird behaviour. I solved it by just inserting my Invert Values function just before the SetRelativeLocationAndRotation node and not setting it to the variable.