Question by
bope1999 · May 16 at 09:51 AM ·
gameobjectdistanceshape
Get Distance from moving GameObject and ProBuilder's PolyShape
Hi, I'm currently trying to implement a labyrinth where you move the ball with the cursor. Now I want to get the minimum distance between the ball (GameObject) and a ProBuilder's polyshape that fits in the center of the labyrinth's path to adjust some parameters. However, when I use "Vector3.Distance" or draw a line between them with "Debug.DrawLine" I see that the distance calculated is between the cursor and the last point from the Polyshape.
Is there any way to get minimum distance from GameObject and any point from the Polyshape, not the last one?
Thanks in advance.
distance.png
(41.5 kB)
Comment