Search Unity

Physics Raycast2D cannot detect Polygon Collider 2D

Discussion in '2D' started by mdookie4, Jan 13, 2019.

  1. mdookie4

    mdookie4

    Joined:
    Jun 15, 2017
    Posts:
    8
    I had an issue with the above, so i tested with a seperate scene, create a gameobject as the firer and another gameobject as target. In the firer, i have a script set the target gameobject and a raycast 2D along the direction of the target, and if the raycast hit, an arrow graphic is instantiated from the firer to the target using velocity and rigidbody2d force. On the target, i first tried to add Circle collider 2D, and the firer fires the arrow nicely. When i changed the collider to Polygon collider 2D, the arrow is not instantiated.

    Anyone experience this?
    Thanks & Regards,