Search Unity

Feedback Debug.DrawSphere

Discussion in 'General Graphics' started by hawaiian_lasagne, Jun 24, 2021.

  1. hawaiian_lasagne

    hawaiian_lasagne

    Joined:
    May 15, 2013
    Posts:
    124
    Hi this is a feature request.

    Can we please have Debug.DrawSphere added. I know there are several other more complicated methods like using graphics.drawmeshnow, or GameObject.CreatePrimitive etc etc, but it just isn't the same.

    The Gizmos API on the other hand is quite fully featured! Except it's tied to GameObjects and thus can't be invoked from arbitary code.

    Please it would be great to have the Debug.DrawXXX api methods fleshed out to at least match the Gizmos api.

    If there is an equivalent one liner then I'd love to know about it, but in which case I would question why its not on the Debug.Draw api.

    On the same note, could we please also have a MeshUtility api to create Sphere's/Cubes etc.

    Thanks!
     
  2. Haxel0rd

    Haxel0rd

    Joined:
    May 20, 2021
    Posts:
    49
    Bump, i was also looking for "Debug.DrawSphere" and i am surprised this is not implemented yet.
    I tried a workaround via gizmos, but it was bugging for me and is not the proper solution i believe.
    Cheers
     
  3. eHaka

    eHaka

    Unity Technologies

    Joined:
    Jan 23, 2020
    Posts:
    11
    FKscore, Keseio, mantisjoe and 2 others like this.
  4. hawaiian_lasagne

    hawaiian_lasagne

    Joined:
    May 15, 2013
    Posts:
    124
    Sure!

    I understand that it's easy. That is kind of my point. It would be great to have this included in the Unity scripting API so I don't have to find this, and maintain my own utility library.

    Hope you understand!
     
  5. fnnbrr

    fnnbrr

    Joined:
    Jan 26, 2021
    Posts:
    11
    For anyone else still looking for this functionality:

    - Debug Drawing Extension is free and will do what you're looking for
    - ALINE is paid, but could be a better solution than the built-in Debug/Gizmos systems for your use cases
     
    AldeRoberge likes this.
  6. Haxel0rd

    Haxel0rd

    Joined:
    May 20, 2021
    Posts:
    49
    Please add Debug.DrawSphere, as the current state is inconsistant,
    where we have DrawLine, DrawRay, but Sphere only via Gizmos.
     
  7. Venividiviciuus

    Venividiviciuus

    Joined:
    Nov 20, 2019
    Posts:
    13
    I don't know but this would be helpful.
    Because Gizmos doesn't allow you to have the same radius as Physics. At least so known.
     
  8. OBiwer

    OBiwer

    Joined:
    Aug 2, 2022
    Posts:
    61
    Hexane likes this.
  9. Venividiviciuus

    Venividiviciuus

    Joined:
    Nov 20, 2019
    Posts:
    13
    Yes, but it is the first choice of google. xD

    No I don't like external scripts. I just fill the project with folders
     
  10. OBiwer

    OBiwer

    Joined:
    Aug 2, 2022
    Posts:
    61
    Install as package? It does not create a folder in Assets/*

    The alternative would be wait till Unity 2028 or somewhat when unity realizes that it lacks in QoL additions and adds this feature
     
  11. Venividiviciuus

    Venividiviciuus

    Joined:
    Nov 20, 2019
    Posts:
    13
    I tried to add Debug Drawing Extension but it seems doesn't work.
    I added the Example script to my gameobject.. but nothing.

    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. [ExecuteInEditMode]
    4. public class Example : MonoBehaviour
    5. {
    6.     //float
    7.     public float debugWireSphere_Radius;
    8.     public Color debugWireSphere_Color;
    9.  
    10.     void OnDrawGizmos()
    11.     {  
    12.         Gizmos.color = debugWireSphere_Color;
    13.         Gizmos.DrawWireSphere(transform.position, debugWireSphere_Radius);
    14.        
    15.     }
    16.    
    17.     // Update is called once per frame
    18.     void Update ()
    19.     {
    20.         DebugExtension.DebugWireSphere(transform.position, debugWireSphere_Color, debugWireSphere_Radius);
    21.     }
    22. }