How to stop an actor rotating when it reaches a specific angle?

I have a black bar with a rotating movement component. It rotates when I press ‘A’. I want it to rotate until it is at a 315 degree angle then stop but I don’t know how.

You can use a lerp rotation, get the current rotation of your object and the final rotation you want


Thanks for your reply, this is new to me. I’ve got this, it rotates my bar from 45 to 135 degrees when I press ‘A’, then back to 45 degrees when I press it again. This part is working, but it flips rather than rotating smoothly. Can you tell me what I’ve done wrong?

You can use a timeline

image

Double click the timeline to create a curve, in this curve you can make a delta float, create a new track and right click on the graph to create key. With this keys you can set their value and position.

Then you can connect the output “New track 0” to the alpha in your Lerp node

image

1 Like

Thanks, I’ve got it working now

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.