Drawing debug lines in the editor

Hi, I have been working on a personal project for a while, and I’m currently trying to draw debug lines in the editor and so far I have found the FComponentVisualization to do it.

The problem I have is that this component only draws debug lines when the component is selected, but there is no way to do it otherwise. From what I saw in the code, it said that since Unreal Engine version 5.4 the ShowWhenSelected() option is not modifiable, so, this means that ComponentVisualization is only visible when selected.

I also saw that you can use DrawDebugLine, but it only works for me when you run the project and it doesn’t work while in the editor.

As can be seen in the FComponentVisualization header:

class FComponentVisualizer : public TSharedFromThis<FComponentVisualizer>
{
public:
	...
	/** Only show this visualizer if the actor is selected */
	UE_DEPRECATED(5.4, "This function is unused and will be removed in a future version. Component visualizers are only shown for the active selection. Use bDebugDraw on the specific component, or the editor setting to control drawing of subcomponents for selected actors.")
	virtual bool ShowWhenSelected() { return true; }
        ...
}

In the deprecation message, it is mentioned that you can use bDebugDraw on the component. But I’m not sure what it’s referring to.

I think I found what I want, I will investigate a bit more about it.
It looks like what I was looking for is the FDebugRenderSceneProxy class.