Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question How to find closest collision point on sphere to surface

Discussion in 'Physics' started by Buttermilch, Jun 9, 2023.

  1. Buttermilch

    Buttermilch

    Joined:
    Nov 23, 2016
    Posts:
    30
    I'm trying to find the closest collision point on a sphere to the surface as you can see here:
    upload_2023-6-9_8-56-53.png

    I've already tried Physics.SphereCast and Physics.SphereCastAll but both don't seem to work for me.
    (Maybe because I've set their direction value to Vector3.zero?)

    Is there another way I could achieve this?
     
  2. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,605