Rotating by XYZ

Hi. I’m trying to make cube rotating 90 degrees with animation on press button. It works with X-axis and Z-axis with no problem. But with Y-axis it rotates different angles and differen directions. what could be causing this problem?

Get rid of this bit

image

Once you’ve setup the start and end points, you don’t need to update them.

Without setting current location after every button press animation starts from start point. If I press rotate 2 times, it makes 2 rotations from 0 to 90, and I need first rotation 0 - 90, second rotation 90-180.

Yes. Do the rotation, then fix the variable. Then do the next rotation. Etc…

( reset the variable on the Finished pin )

Thank you for your answers. I put desired location in current location in the end. Is it correct? Rotation logic seems to work fine now. But animation not working anymore.

Sorry, you were close before.

Like this:

  1. Put current and desired in variables

  2. Enter the time line and lerp between these two values ( but do not set either during the TL )

So this needs to go

1 Like

I got it! Thank you.

3 Likes

Yas! :smiley: