Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Physics2D.ClosestPoint?

Discussion in '5.6 Beta' started by LaneMax, Mar 21, 2017.

  1. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Physics.ClosestPoint has been amazing for 5.6, love it! Was wanting to know if there is plans for a Physics2D.ClosestPoint?
     
  2. JoshGreen

    JoshGreen

    Joined:
    Mar 16, 2017
    Posts:
    28
    Agreed, would love to see it in 2D and think it would be possibly even more useful.
     
  3. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,496
    So there's the new Physics2D.Distance(), Rigidbody2D.Distance() & Collider2D.Distance() but they give you distance, points and normal between two colliders (even negative distance indicating overlap) so maybe that will help.

    I didn't spot this one going into 3D but yes, performing the "Distance" check with a world-space point would be a nice overload for it. Cannot promise when but I can confirm that I've added it to my list of utility stuff TODO.
     
  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I'd love the contactfilter stuff in 3D while we are at it, there's some fantastic thinking in both the 2D and 3D camps but each misses something the other has :)