Quantcast
Channel: Questions in topic: "ignorecollision"
Viewing all articles
Browse latest Browse all 148

How to ignore multiple colliders in IgnoreCollision

$
0
0
I have one game object with one collider, then another with 3 colliders(1 box and 2 circle), I use ignore collisions on both but only the box collider in the 3 collider game object is ignored, when I want all colliders in the gameobject to be ignored. Here's the code I use. if (platBounds.Intersects(gcGO.GetComponent().bounds)) { Debug.Log(1); Physics2D.IgnoreCollision(mainGO.GetComponent(), col.gameObject.GetComponent(), false); } else { Debug.Log(2); Physics2D.IgnoreCollision(mainGO.GetComponent(), col.gameObject.GetComponent(), true); } any idea what I'm doing wrong.

Viewing all articles
Browse latest Browse all 148

Trending Articles



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