Center of Rotation Issues with Mouse Position in UE5

Hello Unreal Engine community,

I’m encountering an issue with rotating a static mesh based on the mouse position in Unreal Engine 5. Specifically, I’m trying to have a static mesh rotate such that it always points towards the mouse cursor’s position in the world. However, the rotation appears to be incorrect, and the center of the rotation seems to be off.

Issue:

Despite setting up these nodes, the static mesh does not correctly point towards the mouse cursor. The rotation appears to be incorrect, and the mesh’s pivot point seems to be offset. I have attempted various adjustments, including using Subtract nodes to calculate the direction vector and ensuring correct connections, but the issue persists.

Request:

Could someone please help identify what might be going wrong with my current setup? Any guidance on correctly configuring these nodes to achieve the desired rotation based on the mouse position would be greatly appreciated. If there’s a more effective method to achieve this in UE5, I would love to hear about it.

Thank you in advance for your help!



Your setup is missing depth (world direction). You may not be able to achieve consistent results without fancier de-projection that accounts for camera frustum.


Consider this approach instead:

Seems very close to what you need. You can skip the trace in the example, and use the Intersection as is.

You are a genius. THANK YOU VERY MUCH!!!