Rotating Objects Based on Player's Axes

I’ve been playing around with this issue for a while and have yet to figure out a satisfactory solution. Hopefully someone here can help.

A core mechanic of my project is that the player can pick up objects, move them around, rotate them, throw them, etc. Everything works, except the rotation.

Every object the player can pick up has a rigidbody with high angular drag so it doesn’t rotate on its own while the player is carrying it.

I want to be able to rotate the objects relative to the player’s facing, rather than their own axes. If I press the “rotate clockwise” button, for example, it should appear to rotate clockwise from the player’s perspective, regardless of which direction “forward” is for the object itself. Is this even possible? If so, what’s the best approach?

EDIT: Found a solution on another forum: I used RotateAround, with the transform that acts as a parent to the held object as the parameters.

Use Transform.Rotate with relativeTo=Space.World, and use your player.transform.forward/right/up as the world axis:

public void Rotate(Vector3 axis, float angle, Space relativeTo = Space.Self);

For example rotation around player.transform.forward will rotate it right (around the forward axis) from the player’s perspective.

ps. I don’t know how your player is carrying those objects, but I’d say angular drag isn’t the way to do it. If you are using physics, a simple way is to joint the object to your character’s hand using ConfigurableJoint with targetPosition=Vector3.zero and linear drives on all 3 axes, which will make the object snap to your character’s hand, as the drive will pull it towards it.