- Home /
Enable / Disable Layer Collision Matrix thru Script
I know that you can disable certain Layers in script by calling Physics.IgnoreLayerCollision (layer1, layer2). But I can't seem to figure out how to enable them back. I've tried the Physics.GetIgnoreLayerCollision (layer1, layer2), but that didn't seem to work. Any ideas?
Comment
Best Answer
Answer by ILoveMyDada · Sep 23, 2018 at 12:13 PM
Never mind I figured it out. Didn't realize you can set a bool true/false like so for anyone who is wondering about this:
Physics.IgnoreLayerCollision (layer1, layer2, true) Physics.IgnoreLayerCollision (layer1, layer2, false)