Hi, am porting a simulator project of mine to unity and cant seem to work out how to calculate torque to apply to the RB.
So in a loop I am calculating various forces up from around the rigidbody at different positions ending with a resulting overall force.
I want to do the same for torque, so for each force in the loop, calculate the resulting torque from that force on the RB.
Anyone know how I go about this?
My current method which im not sure about… This is in a loop i
Vector3 local_final_force = transform.InverseTransformVector(finalForce);
Vector3 force_pos_localspace = forcePos[i].transform.localPosition;
Vector3 final_torque = Vector3.Cross(force_pos_localspace, local_final_force);
//Vector3 local_final_torque = transform.InverseTransformVector(final_torque);
current_force.torque = final_torque;
I then add all these up late and apply them using RB.AddTorque but im not convinced its correct, its certainly not behaving like it should.
Thanks