I’m implementing a feature where a player can examine an interacted object by rotating it, a common feature in many games. However, I’m struggling to get the rotation logic working correctly.
My goal is for the object to rotate right when the mouse moves right and up when the mouse moves up, regardless of the object’s current orientation. However, I’ve encountered issues with both world coordinates and local coordinates.
Using world coordinates, the rotation behavior changes depending on how the player interacts with the object, as shown in the video. Additionally, the Yaw movement isn’t what I’m aiming for.
Using local coordinates, the initial rotation is exactly what I want, as seen in the beginning of the video. However, as I rotate the object, the local axis shifts, causing the rotation to deviate from the desired behavior.
After researching, I discovered that I might be able to achieve the desired effect by multiplying the mouse input with the camera’s angle. However, even after setting up the blueprint as shown below, it still doesn’t work as intended.
Thank you guys for your advise!
As you suggested, I tried using Add World Rotation, but the object’s behavior remains unexpected, similar to when I was using Local.
I believe the issue must be rooted in a different part of my code.
I’ve reviewed the linked resource, but unfortunately, it didn’t provide a solution to my specific problem…