Make actor rotate on clicked more than once

Hi, I have an actor that when I click it I set relative rotation and have a timeline to rotate it 90 degrees. But when I click it again it does nothing. (Mainly because the timeline has ended). How do I make it so it goes another 90 degrees when clicked again and again and so forth.

Player click > Rotates 90 degrees > Stops > Player clicks again > Goes another 90 etc

Thank you.

Hey,

Start the timeline from Play from Start. For the rotation, save the current rotation before the timeline is executed, then add the offset as the timeline plays.

Let me know if more help is needed.

Hi @Maplenuggets ,

One possible solution that could work for you is to get the current rotation directly from the component using Get Relative Rotation and use two Float variables called Start Rotation and Target Rotation, which represent the rotation in degrees on the Yaw .

Each time we click, we get the component’s current rotation and store its Yaw value in Start Rotation. Then, we add 90 degrees to Start Rotation and store the result in Target Rotation. This way, each new rotation is calculated based on the component’s current orientation, adding an additional 90 degrees. After that, we play the Timeline using Play From Start instead of Play to ensure the animation always starts from the beginning.

We then connect the Timeline’s New Track output to the Alpha input of a Lerp (Float), which allows us to interpolate between Start Rotation and Target Rotation. The Lerp’s output is applied to the Yaw of Set Relative Rotation, creating a smooth rotation effect.

We also use the “Is Playing” node to ignore additional clicks while the Timeline is playing, preventing the animation from restarting or multiple rotations from being queued before the current movement has finished.
For example, if the object is still rotating and is currently at 50 degrees when we click again, the new target rotation would be calculated from that intermediate value, resulting in 140 degrees.

By doing it this way, we always get the rotation directly from the component on every click, ensuring we’re working with the object’s actual rotation at that moment.

Hope it helps!