I have a tank with 3 rigidbodies and with configurable joints locking them to one another.
Body<–Turret<–Cannon are linked together with configurable joints. The turret rotates on X and the cannon rotates on Y (the joint makes the cannon rotate with the turret on X). When the cannon collides with something that has a higher mass than it, it pulls away from the joint and goes springy. SO, if I just make the cannon’s mass large enough, this should not happen when it collides with lower mass objects. HOWEVER, the cannon does collide with the body at times. The body is 55X heavier than the cannon and must stay that way, otherwise the tank tips over or even flips. So I thought of Physics.IgnoreCollisions.
First let me ask if Physics.IgnoreCollisions even does what I think it does: When the cannon collides with the body, I think I can tell it to ignore the collision and the cannon will pass through the body. Is this correct?
If this is the case, then here is the error I am getting:
Ignore collision failed. Both colliders need to be activated when calling this IgnoreCollision
I have checked and the “.collider.enabled” returns true for the cannon, turret, and body. Is enabled the same as activated?
Why am I getting this error on
public Rigidbody transform1;
I, in essence, want to ignore collisions that any rigidbody has with any collider in this instance of the prefab. However, I don’t want it to ignore collisions with a separate instance of the prefab, only self. The tanks need to be able to run into each other and they are all on the same layer.
To put it another way, if my arm hit my body, I would want it to pass through me like a ghost. But if my arm hits you, I want it to collide.