Announcement

Collapse
No announcement yet.

Rotator fluctuates between positive and negative during easing function.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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.

    Click image for larger version

Name:	LerpWeapon_2.png
Views:	1
Size:	122.2 KB
ID:	1217102

    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.

    Click image for larger version

Name:	LerpWeapon_3.png
Views:	1
Size:	494.4 KB
ID:	1217103

    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.

    #2
    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.

    Comment


      #3
      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.

      Comment

      Working...
      X