Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Racast2D ignores Collider2D with IsTrigger = true

Discussion in '2D Experimental Preview' started by Habitablaba, Feb 20, 2017.

  1. Habitablaba

    Habitablaba

    Joined:
    Aug 5, 2013
    Posts:
    136
    I have an object with two Collider2D on it, the first is sized and offset to only cover the bottom half of my object. It has IsTrigger = false. I am casting a ray from my mouse cursor when I click. This properly finds the object if I click on the object where it is covered by this smaller collider.

    The second collider covers the entirety of the the object, and is set to IsTrigger = true. When I click on the object where it is covered only by this larger collider, the cast ray does not find the object. I've checked the physics and physics2d settings, and they both have Queries Hit Triggers checked.

    I've been able to work around this problem for now by creating a child object, moving it to a layer with no physics interactions, and making the collider not a trigger. While this is workable, it is obviously not ideal.
     
  2. Coffein

    Coffein

    Joined:
    Jan 22, 2016
    Posts:
    19
  3. Habitablaba

    Habitablaba

    Joined:
    Aug 5, 2013
    Posts:
    136
    Oops! Definitely thought I had that already, sorry everyone, nothing to see here