Rotating a cube once

Hi,

I’m trying to smoothly rotate a cube but I cant seem to figure out the proper way to do it. What I want is to swipe in a certain direction and the cube rotates in that direction. I already have the build reading the correct swipe functionality. I am now trying to set up the rotation. What I currently have does rotate it after swiping, but it does it fast and it doesn’t look good. I basically want it to do a smooth rotation like over 1 or 2 seconds until it reaches the correct position. So for example go from 0 to 90 on the yaw or 0 to -90 on the yaw. And be able to keep rotating after every swipe.

This screen shot shows how I got it to rotate with an event tick and timeline

This one shows how I did it without the tick, just connected it to my custom swipe event

Both have the same fast result, where the cube rotates from 0 to 90 in like 0.1 seconds

Any idea what im doing wrong?

Hi! You are using the timeline on the tick. Each frame it starts the timeline from the start. If you use a timeline, you should rather trigger it with an event, once.
If you want to do it on tick, you should use a Rinterp node instead of a timeline. It smoothly interpolate between 2 values. The first one is the current, the second one the target. Then plug “get world delta seconds” into time and set a speed.
There is Rinterp which is eased on start and end, and Rtinterp constant which is linear.
After the “set rotation”, compare the current and the target and if they are almost equal, set a bool to false or use a gate so it will stop

Change ‘EventTick’ with ‘EventBeginPlay’.