- Home /
Question by
Ryox92 · Aug 13, 2021 at 02:39 AM ·
uicanvascollider2dcollision2dontriggerenter2d
2D colliders not working with UI?
Hey everyone,
I have a coin meter image in a canvas with a circle collider 2D component. I'm moving coins to the coin meter when they are picked up but for some reason I'm not getting any prints in OnTriggerEnter2D or OnCollisionEnter2D.
I double checked to make sure set up is correct, tags and the collisions are enabled for the 2 layers I'm using (UI/Default).
I can't seem to figure out why its not working, am I not supposed to use 2D colliders with UI?
Thanks
Comment
Try adding an empty gameobject as a child of the UI and then move the collider onto that empty gameobject.