Godot Version
4.7.2 stable
Question
I was curious if there is a way to debug things in 3D with custom shapes/objects, kind of something like that of Unreal’s “Draw debug Sphere” or “Draw Debug Box” etc.. Basically simple functionality that would allow to spawn in these debug objects for a certain duration.
And I know you could technically do that by making your own versions of this and setting materials and all but I am pretty curious about a built in way to do this because I feel like we already sort of have that functionality no?
For example RayCast3D and ShapeCast3D both have debug previews of their shapes that you can even change colors of. Even stuff like CollisionShapes have their own debug shapes, so do we have anything to create these programmatically? A few simple functions for this would be quite nice for a lot of 3D debugging purposes (and would be nice to able to adjust line thickness
)
It could also be its own nodes not just functions, so you could change the debug node’s parameters on the fly.
You can programatically build a mesh.
Hmmm, I mean fair enough that is definitely an option. Extending some of these classes and creating my own “debug” objects is also an option, but since we already have a way of debugging that is sort of there, it felt natural to me that we would have access to these things to draw them via script or nodes.
Saying this not to dismiss the comment just wanted to provide more context on my thoughts 
Not sure what exactly you want to draw. The engine already draws all collision shapes.
Ah sorry for not being clear enough then 
I was mainly referring to how in Unreal for example you have a method/function to call “Draw Debug Sphere” where you can input in it the parameters like position, radius, thickness, duration it is going to be displayed for etc.. It is basically a shape that is purely visual and does nothing else.
It would be useful for 3D debugging to have something similar in Godot too (I assumed there was and that I wasn’t aware of it or couldn’t find it). It would basically just draw a debug object with specified parameters.
In contrast doing that now I would kind of have to “cheat” and create a mesh to debug it or extend like a collision shape class and then feed the parameters and so on..
I hope I cleared it up a little bit
You can’t really do it without making a mesh instance node (or the equivalent on the RenderingServer). The closest thing would be to use ImmediateMesh resource with it. It has an immediate style drawing api. You can just “re-draw” things every frame or draw once and then transform.
I think it would be a nice inclusion for the engine, but since it is already possible without too much work, these debug draws or on-screen error messages are not going to make it into the engine. There are surely some addons though!