Hi, I’ve been having a problem when I try to have an actor look at another actor at a set speed. I’m using a Find Look at Rotation node connected to a finterp to (I only want one axis of rotation). But, at the magical angle of 180 degrees, the actor wants to take the long way around to rotate a small distance. From my investigating, I think it has something to do with how Interp To nodes work or how the Find Look at Rotation node works. Does anyone know how to solve this?
Try chucking a clamp axis in between the interp and set rotation that will change it from a 180 positive, negative range to a 0 - 360 degree range.
Use a timeline to handle the rotation speed vs snapping.
TL update → Lerp (rotator) → Set Actor Rotation
I considered using a timeline, but I decided the implementation wouldn’t really work because I want it to be constantly running. The event to rotate is on a max once per frame timer by event node.
This has no effect on the rotation. I’ve tried doing things such as adding 360 if the number is negative to try to make it positive, but that didn’t really work.
Yeah wasn’t sure if that would help or not just thought I’d suggest.
Normally for lerping any rotation I find it’s best to use the rotation lerp because it has the shortest path check which helps, so for a single axis I’d just do like this.
Run the lerp on the full rotation but then only use the yaw value at the end. In that example I am running it on tick but you could run it off any repeating code, if you’re running slower than delta time you’ll need to take that into account too as the alpha value based on the tick rate of the code will give you your overall speed.
For a single axis rotation I recommend doing it this way:
You can create a function library to make it reusable anywhere.
Thanks for the help. I didn’t realize that interp (rotator) had more functionality than the regular interp or interp to. I will definitly keep this in mind when I need to lerp in the future.