Hey there, first post so correct me if I’m doing anything wrong.
At the moment I am trying to create a world where as the character walks through a doorway the room they came out of disappears.
At the moment I have been able to disable all the renderers of the children objects(They sit under the trigger object), but when I apply the same logic to the Colliders it doesn’t work (character still runs into wall).
May question is why?
function OnTriggerEnter(){
meshChildren = gameObject.GetComponentsInChildren.<MeshRenderer>();
for (var mesh : MeshRenderer in meshChildren) {
if(mesh.gameObject!=gameObject)
mesh.enabled = false;
//THIS PART WORKS
}
meshColChildren = gameObject.GetComponentsInChildren.<MeshCollider>();
for (var collider : MeshCollider in meshColChildren) {
if(collider.gameObject!=gameObject)
collider.enabled = false;
//THIS PART DOESN'T
}
}
As far as I can tell it should work
Many Thanks for any help