Hey Guys,
I have a question regarding edge collider 2D.
So I created my own 2DEdge Collider (by setting its points). Collider is set to Triggered.
Now, is there any way how to detect if there is a collision with another point of the 2 Edge collider?
For example:
Ball is falling to 2D EdgeCollider:

Now, OnTriggerEnter() is called:

Then when it touches another point in 2DEdgeCollider - I need callback:

Or is there any way how to workaround without having multiple objects with small colliders.
Cheers for your help.
Sounds like the best solution is to create a small circle trigger at each point. You could do this programmatically to avoid the headache of manually creating them.
Alternatively you could be checking OverlapPoint() and iterating through each point in the line each frame.
Yes but then it is better to have multiple objects and on each object circle trigger, no?
For your second suggestion, the overlapPoint(), it will have to be called on every frame from “ball”, not from edgeCollider2D.
Please correct me if I am wrong
You can call Physics2D.OverlapPoint from anywhere and check for anything you like. So you could have the edge collider object checking all its points for ball objects (since the ball has a collider) and responding to what it finds or doesn’t find at each point.
The best way to do things from the ball’s perspective would be to add colliders to the edge points so they can be detected separately from the edge itself. The ball really should only be responsible for itself, so you don’t want to have the ball be responsible for knowing about the edge and checking its points.