Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct here to familiarize yourself with the rules and how to post constructively.

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice

physics2d.OverlapCircleAll not detecting collisions with horizontal segments of edge collider.

Discussion in 'Physics' started by TokyoDan, Jan 22, 2019.

  1. TokyoDan


    Jun 16, 2012
    I am using physics2d.OverlapCircleAll to detect collisions between a game object's circle collider and an edge collider that has both a horizontal (floor) segment and a vertical (wall) segment.

    The game object falls down in the Y axis to STOP on the horizontal (floor) segment of the edge collider and can move left or right along the horizontal (floor) segment of the edge collider in the X axis and can crash into the vertical (wall) segment of the edge collider.

    The problem is when the game object's circle collider is in contact with the horizontal (floor) segment of the edge collider, OverlapCircleAll DOES NOT detect any collisions.

    I am pretty sure I am using OverlapCircleAll correctly because when the circle collider contacts the vertical (wall) portion of the edge collider OverlapCircleAll DOES detect collisions.

    The game object doesn't fall through the 'floor' and it also has a Rigidbody 2D with the Collision Detection is set to Continuous. I am using a layer for the edge colliders. Unity is 2018.3.0f2

    Is this a known problem? Am I doing something wrong?