Actor rotation. Need some help

I must be missing something, because of all the things, I can’t make proper actor rotation in my blueprints. The result is always messed up and I don’t understand where I’m making a mistake.
So I’m asking for help now.

Please - tell me what am I doing wrong so I can feel dumb and then move on with my life and make proper blueprints!

Here’s an example. I’m experimenting with making a digital clock. Not like, real time or anything (i’ve seen a tutorial on that), just a background object that makes noises and moves.

And the end result… Well, this: - YouTube

The thing is - I’m interested in making controlled rotation via timeline. What I mean is - I have, for example, light switches. They work as intended - you flip the switch, it changes the angle, light turns on and the other way around. But when I tried to make the flip not instand and a bit smooth, I used timeline and nothing worked. So I’m assuming I’m making the same mistake as with the clock. Except I don’t understand - where and what?

Out of curiosity I migrated the same clock blueprint to a different project… And there it behaves completely different! Regardless of where the Rotation Angle variable goes - x, y or z - it’s constantly rotating around Z axis… I just don’t understand what’s happening here :\

I kept on experimenting and this -

  • works as it’s supposed to… Sort of. The thing is - only Z axis will go past 90 degrees. X and Y will “tick” every second until they reach 90 degrees angle from it’s original location and then start hopping in place.

I’m still looking for clarification on how to rotate actors with timeline… I’m so confused right now.

Edit: Nope, turns out that doesn’t work either… It’s all messy… I give up. I’ll just wait for someone to reply, hopefully.

Hello, Kligan,

You are lerping from one rotator to another (representing rotation at last second, rotation at current second) but those never change and never get updated.

So you are always lerping between the two same unchanging angles, thus the behavior in your first video.

You could just set a timeline with a length of x seconds going from 0 to 360 and plug that to the yaw of a make rotation, and plug that into the set world rotation, no need to use lerps. But that would give you a continuous, smooth rotation, and I am asuming that you want a more clock-like, move and stop, movement. Thus the lerps.

Do this: Create a custom event called update angles. Also create 2 rotator variables: current rotation and last rotation. When your event fires, first set last rotation with the value of current rotation, and then get the current rotation, add to its yaw 360 between the number of rotation segments you want, and set it to the new value.

Now, on your timeline, create an event track (called update rotation), and add a keyframe at 0 seconds. You will see that your timeline now has one extra execution pin, named like your track. From that pin, fire your custom event.

Current rotation and last rotation would be your A and B pins on the lerp.

Hope this makes sense. All the best.

I mean, I figured i need to update the Rotation variable, so the logical thing was to “set” it each time the timeline is finished. And it just doesn’t work. I don’t understand why.

Last night, after I tried to make things work again, I finally found the solution for the clock atleast. It’s sort of what you suggested, but done in a different way.

It’s basically the same thing I did before, except I made it independent of frame rate and moved “set rotation” to a different place.
It makes me sane again to know that I had the right idea, but still confused about why it didn’t work when “set Rotation” was supposed to be updated from “finished” pin in timeline.

And also what I don’t understand is why X or Y rotation always goes only up to 90 degrees and then starts jumping in place? Only Z works “forever” so to say.

Right, you were updating. Sorry, I didn’t see it correctly.

I am not sure. Might have been that when the finish pin fires, it is no longer outputing the values from the timeline (like it fires after there are no more values to output, instead of on the last value, and doesn’t hold it). Would be interesting to print the timeline value on finish to see what it is doing.

On the other hand, for the rotation, remember that there are different ways to interpret a cartesian rotation in 3D, depending on the order of the operation on the different axis, so while your numerical value will look different to what you expected (one or two of the axis will have a “break”, and go to 90, -90 or something similar) it is supposed to be the same angle.

Instead of manually making the rotator, might be better to use a rotate around axis and input a float instead. That would keep it easier to follow.