First, sorry for my poor English.
I watched great tutorials and succesfully create a feature that allows the player to draw some lines on the scene (use LineRenderer) and put polygon colliders on the lines.
Now I want to be able to add a pivot on top of these lines, or on the inner space enclosed by these lines.
For example, draw a triangle, add a pivot to the interior space of the upper side of triangle, and draw a long box on top of it to make a simple balances or seesaw.
I was thinking of implementing it this way:
(1) draw a triangle object,
(2) try to add a pivot to it,
(3) if the point is in the interior space of the triangle object, add the pivot object as a child of the triangle object.
(4) draw a rectangle object on top of the triangle object,
(5) if the interior space of the rectangle object contains the pivot of the triangle object, add a Hinge Joint 2D to the rectangle object, set the Anchor to the location of the pivot, and set the rectangle object as a child of the triangle object.
But I haven’t found a way to make it in days.
Is there a good way to determine if a space is surrounded by colliders and a good way to check if there is a pivot object inside when an object is drawn by player?