AddTorque no longer working when collider is added

I have a space object in my game with gravity disabled, it’s not kemantic and has child objects that add torque or forces based on inputs. (Such as gyroscopes and engines). It was all working fine until I added a collider to the space object. Now whenever I try to add torque to object it doesn’t respond.

When I add a rigidbody.AddRelativeForce works fine, but the rigidbody.AddRelativeTorque function doesn’t show my object as moving whatsoever, which it does when the collider is disabled. I’ve tried different types of colliders as well (mesh, cylindrical, rectangular) with no different results.

Another odd result is that when you enable the collider and then disable it the torque still doesn’t work, while if you disable the collider from the start the AddTorque function works fine.

I’ve included the code that is related to the gyroscopes, as well as the collision and the working ApplyForce function.

###SPACE OBJECT CODE:##

	void OnCollisionEnter(Collision collisionInfo) {
		print (collisionInfo.gameObject.name);
		rigidbody.AddForceAtPosition(collisionInfo.relativeVelocity, collisionInfo.contacts[0].point);	
	}

	void ApplyForce(Vector3 force) {              //This is for the engine and
		rigidbody.AddRelativeForce(force);    //works fine.
	}
	
	void ApplyRotationalForce(Vector3 torque) {   //This is for the gryroscopes
		rigidbody.AddRelativeTorque(torque);  //and does not work when the
	}                                             //collider is enabled.

###GYROSCOPE CODE:##

if (Input.GetButton("Pitch")) {
    transform.SendMessageUpwards("ApplyRotationalForce", new Vector3(Input.GetAxis("Pitch"), 0, 0) * strength/10);            
}

###HIERARCHY:##

  • Space Object
    • Gyroscope
    • Engine

Has anyone else had a similar problem that they got around?

– EDIT –
New revelation: When the input is pressed, the rotation fluctuates within 6 degrees, however the space object itself doesn’t budge. Could this be a problem with the mesh rendering?

Did you ever find a solution to this, i have exactly the same issue.

Solution found here

Richard Buck:

I also found a sudden change in behavior when I added a collider. I was applying a torque to my Rigidbody to rotate it, but after adding the collider the effect of the torque was massively reduced.
I realised that the reason for this is that before the collider was added, the object effectively had a point mass (i.e. zero volume). The collider defines the volume of the object’s mass, so after adding it the object’s mass was no longer a single point, meaning that a larger force is required to rotate it at the same rate, exactly like the real world (think about pushing someone on a roundabout with them at the center, then at the edge).

Consider using ForceMode.Acceleration to manipulate objects without having to worry about their mass distribution.