I need to use Rigidbody.rotation which seems to take only a global rotation.
The problem is that the value I get from other functions I’m using is the local rotation of the object, so I need to convert that local rotation quaternion into the corresponding global rotation to pass to the rigidbody.rotation as a parameter.
yeah, I googled and found that one too but it didn’t work. Not sure if it was my fault or the way to do it on there is wrong. In my case also I don’t have a “parent” to compare to, because my object is the parent itself.
Well local rotation can be viewed as the rotation - parent.rotation (transform.rotation * Quaternion.Inverse(parent.rotation). So if you want to ‘set’ a local rotation of a rigibody, you can generate a world rotation by combining your ‘local’ rotation and the rotation of the parent, and applying that to the rigidbody.