So basically I am working on trying to get rigidbody Vr hands working(but the Vr part isn’t really important) and I need one last thing. I need to get the rotation of the hand anchors and tell the hands to match the rotations. I think I need to use rb.AddTorque() but I can’t find anything on how to match rotation and then also controlling the speed of the rotation would also be nice. Any help would be amazing.
Have you looked at Unity - Scripting API: Rigidbody.MoveRotation ?
Yes I have but I am not using Kinematic rigidbodies so it won’t work for what I have(Teleports the object (rather than a smooth transition) if it has isKinematic set false). So I think I have to use rb.AddTorque() but I am experiencing glitches when I do. It is mostly giggling of the hands. This is what I have gotten to slightly work with what I got:
rb.AddTorque(new Vector3(handLocation.GetComponent().rotation.x - rb.rotation.x, handLocation.GetComponent().rotation.y - rb.rotation.y, handLocation.GetComponent().rotation.z - rb.rotation.z) * rotationSpeed * Time.fixedDeltaTime);
You specify you are not using kinematic rigidbodies. i.e. IsKinematic is not checked. If this is the case and you wish for controlled rotational displacement then MoveRotation would be the best method to use. See if the attached example is helpful.
Note, if you have camera focus on a rigidbody, you will probably want to set the rb Interpolate option to Interpolate.
HTH
Al
6408486–715542–test.unitypackage (4.85 KB)