simply math question - rotate actor facing the camera

Hello,

I can currently pick up an object Simply put, I can “pick up” ab object Skyrim-style, and it will follow the player. This is done using the “PhysicsHandle” component and the “Grab Component” method.

The issue is that I want the object to rotate according to wherever the camera is looking. The code I have for that looks like this: (this is run ON TICK)

However, unfortunately it doesn’t rotate it exactly to the camera, and rotates differently depending from which angle the object was picked up.

You can see it’s not facing the camera.

This should be easy to fix, I would like to know how.

Thanks in advance!

That’s because you’re setting the rotation of the Physics Handle that is, if I understand it right, a mere point in space, and its rotation doesn’t really matter. Instead, you need to set the rotation of the picked object. Whenever you pick it, save it to a variable, say, “Current Held Object”, and set its rotation.

Do you need your subject to look directly into the camera? It looks good too.

The most important advice is to double-check all the data; first, there may be an error somewhere. There may also be a problem in geometry. In general, it would be better to get acquainted with the theory of mathematics for a better understanding of the process. I recently recalled a student program with this educational site [ and filled in a lot of gaps. Maybe it will be helpful for you. Often, young programmers and 3D visualizers lack basic knowledge of mathematics.