- Home /
[noone knows] substitution for EdgeCollider2D.OverlapPoint ?
anybody knows how to work this around? as the EdgeCollider2D is line and not polygon, there's no native method to get if certain point is inside or outside, does anybody have idea how to find out? (of course first point == last point)
edit: i actually believe it's not possible without few raycasts - my first thought is to raycast in 4 directions and count number of intersections and if the count is even, then it's outside and if odd then inside, however i am looking for some "system" solution i'm maybe missing
be so kind and don't delete the [noone knows] tag because i believe it's more ethical to attract pro's eyes on another then landing page instead of popping up the question and make other questions move downwards (as you can see in my profile i don't use this tag on every stupid question i have ever had
I am just curious why are you using Edge ins$$anonymous$$d of poli?
because polygoncollider2d doesn't accept all vertices i give it because it's too close (http://answers.unity3d.com/questions/871904/collider-vertices-too-close.html)
thank you fafase i know about it already, i am just looking for some solution based on physics, as i need to do it on few objects every frame, this one would be great on simple objects, i was using it in flash long time ago
it looks like there's no simple solution so i will stick with the one i am using now i guess, let's see if somebody finds better one