Quantcast
Channel: Latest Questions by zenforhire
Viewing all articles
Browse latest Browse all 83

Rigidbody should only torque around selected axis

$
0
0
Hi All, Tuning the turning radius of a ship. It flops over and pitches in the first 90 degrees of course change? It slowly rotates around local Z and X axis too. I only want the y axis. I apply forward force in Z direction. I torque around the Y axis. gravity is off capsule collider in the Z direction. mass = 500 cg = ( 0.0, 0.0, 0.0 ) Relevant code: // the force is relative to the rb local corrdinate system bodyToPush.AddRelativeForce( 0.0f, // x : float, 0.0f, // y : float, force, // z : float, ForceMode.Force ); // mode : ForceMode = ForceMode.Force) : void protected virtual void applyTorque( float torque ) { //print ( "torque: " + torque ); Rigidbody parentRB = connectedRigidbody.rigidbody; parentRB.AddRelativeTorque( new Vector3( 0.0f, torque, 0.0f ) ); } Cheers, Kevin

Viewing all articles
Browse latest Browse all 83

Trending Articles