Hi, i've bumped into a problem, i have an enemy (default layer) character which after death is switched to ragdoll which should have another layer, so i'm switching enemy's layer via script: Code (csharp): ... currentRagdoll.layer = 12; Physics.IgnoreLayerCollision(8, 12, true); ... but the problem is that the children of the "enemy" do not change their layer... When i'm changing layer in the inspector it asks me if the changes should be done to the children of the object. How to do it via script.
solution was simple... Code (csharp): ... children = currentRagdoll.GetComponentsInChildren<Transform>(); foreach (Transform go in children) { go.gameObject.layer = 12; }