How to make objects rotate indefinitely in Unreal Engine

- by

I bought the Synty Farm Asset pack recently. The demo level looks great, except for the fact that the windmills dotted around the farm are not rotating. This looks a little bit out of place with the rest of the animated scene. Being the newbie that I am, I was wondering how I could make the mills turn, and thankfully I’ve found a solution. Let me share it with you here.

The first thing we need is an AddActorLocalRotation node. Type “rotation” in the search field and you’ll see a huge variety of nodes popping up. Some others will work, however in my experiments, the ones suggested by other sources did not rotate my object 360 degrees (let alone indefinitely). AddActorLocalRotation seems to do the trick though.

Next, drag off the Delta Rotation parameter and add a Make Rotator node. This will let us choose around which axis the object needs to be rotated. Thankfully we’re getting XYZ values in addition to the more “proper” values which sadly mean nothing to me. From the object in my viewport I can tell that I need the Y (Pitch) value. The simplest way to make this thing spin is to hack in a value here manually.

A more elegant way would be to promote our desired input to a float variable. The advantage is that we can now set the value from outside the Event Graph, and without having to re-compile the Blueprint if we want to make a change to the rotational speed.

Click Simulate to see the effect in the viewport, or play the level with your Blueprint actor in the scene.

Add your voice