Making an actor look at another one in Unreal Engine

- by

A few years ago I’ve described how to rotate an actor towards a location with the use of the Lerp node. This thing can interpolate two float values and as such is a very multi-purpose function. I’ve just found out that Unreal Engine has a dedicated “rotation interpolator” node called Rinterp. It takes two rotation values and lets us specify a time over which they should interpolate. Here’s how it works:

In this example, this actor takes the location of another, finds its own look at rotation, then updates its own rotation towards the target (through the look at rotation). I’m doing this over 2 seconds, as specified in the Interp Speed value. Note that this node needs Delta Time so it can calculate this as time goes by in the game.

Pretty neat, huh? It’s a much more elegant solution that the use of timelines and Lerp nodes.



If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site without any pesky ads! More details here.

Leave a Comment