I draw a triangle with the edge collider2d and I want the player to make an event when he reaches this area,

so I set the collider as a trigger and, I used the OnTriggerStay2d function in my code!

but only the event working when he is en trigger with the line of collider !!

Thanks in advance


No, you cannot. An edge collider is just that: an edge. It has no internal area to test with, it's just the edge and nothing but the edge.

To represent a shape with an interior area, you can use a PolygonCollider2D


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.