Search Unity

How to visually debug Physics.OverlapSphere?

Discussion in 'Physics' started by boynet, May 24, 2017.

  1. boynet

    boynet

    Joined:
    May 20, 2017
    Posts:
    17
    the only thing that came to my mind is to create a sphere object and give it same size and location of Physics.OverlapSphere the problem is unity sphere is getting a vector3 as size and not a radius so I cant get to to be on same size;
     
  2. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,537
    The scale will be Radius * 2.
     
    yuriyvedernikov likes this.
  3. HiddenMonk

    HiddenMonk

    Joined:
    Dec 19, 2014
    Posts:
    987
    Eater_Games likes this.
  4. boynet

    boynet

    Joined:
    May 20, 2017
    Posts:
    17
    thanks I think that's it working great :)

    why unity dont provide built in function for that otherwise when I use Physics.OverlapSphere with some radius it's just guessing
     
    americoh3, anattress and Eater_Games like this.
  5. andreycom13

    andreycom13

    Joined:
    Jan 20, 2017
    Posts:
    2
    Code (CSharp):
    1. private void OnDrawGizmos()
    2.         {
    3.             Gizmos.DrawWireSphere(position, radius);
    4.         }