Quantcast
Channel: Answers for "When changing a gameobjects layer, the physics collision matrix is not being respected immediately..."
Viewing all articles
Browse latest Browse all 6

Answer by Jonathan-Bro

$
0
0
I ran into this bug just now and found a good workaround for it. Try disabling then re-enabling the collider after setting the new layer. this.gameObject.layer = LayerMask.NameToLayer("IgnoreAll"); this.collider2D.enabled = false; this.collider2D.enabled = true;

Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>