Look at rotation - how to prevent swivel?

Hi, I have a flashlight mesh attached to the player, which is looking at a light using look at rotation in a blueprint. It works great when I’m looking straight ahead. However, when I’m looking up or down the mesh swivels left and right. Am i doing something wrong? Here is a video of the issue:

And my blueprint:

I thought about using a branch node to use a different type of rotation depending on if i’m looking up/down, but that resulted in a nasty looking snap as it swapped between the two states.

Any help would be hugely appreciated, thank you!

Im thinking it might be a problems when using Euler instead of Quaternions. Try googling on how to use quaternions in UE4 :slight_smile:

Your life will be easier if you parent the flashlight to your camera, and do all extra calculations in local space.

If you want to do world rot, you could try breaking that rotator, make a new one from it, and ignore the Roll value;


Though, since you’re in world space, you’ll likely have a bad time anyway. Local space is the way to go for this stuff.

Thankyou bzxo. Based on your answer that I need to use local space I was able to fix it.

Here is the solution blueprint: Look at rotation without swivel bug posted by anonymous | blueprintUE | PasteBin For Unreal Engine 4

The beam is parented to the camera so you are correct that I needed to use local space. That immediately fixed the issue.
Then I added in a bit extra so when i’m looking straight up/down then it doesn’t wiggle from side to side quite as much. Now it looks fantastic!