- Home /
Question by
jjf21 · Sep 19, 2021 at 06:47 PM ·
rotationrigidbodyquaternion
Rotate Rigidbody to always face a force
hello, I am applying a force to a Rigidbody and I want the RB to always face this force. I tried
float angle = Vector3.Angle(rb.transform.up, forces);
float newAngle = rb.transform.rotation.x - angle;
rb.transform.eulerAngles = new Vector3(newAngle,0,0);
But it does not work, and it is not fluid. I think I need to work with rb.moveRotation and Quaternion. Any idea ? Thanks
capture-decran-2021-09-19-a-204306.png
(27.7 kB)
Comment