I have two Rigid bodies a firearm and a mag. When the mag is attached I do this
public void AttachMagazine (Magazine magazine)
this.Magazine = magazine;
this.Magazine.CanInteract = false;
this.Magazine.Rigidbody.isKinematic = true;
this.Magazine.Rigidbody.useGravity = false;
this.Magazine.Rigidbody.detectCollisions = false;
I also update the position of the mag each frame so that it appears to be attached to the firearm. Only problem is that firearm cant go through walls but the attached magazine can. If i dont set this.Magazine.Rigidbody.isKinematic and this.Magazine.Rigidbody.detectCollisions it will go complete crazy.
So my idea is somehow to clone the colliders from the magazine to the firearm so that it firearm get teh correct shape with the attached magazine., But cant firere out how todo it, any ideas?