How to draw HUD in editor?

Extending LevelEditor is a good idea, I’ll try it.
And also I managed draw MyHud (Which extends AHUD) in editor,
since AHUD is an AAtcor, so I just spawn it refer to APlayerController::ClientSetHUD_Implementation method in PlayerController.cpp,
then assigned the debug canvas using UCanvas CanvasObject = FindObject<UCanvas>(GetTransientPackage(),TEXT(“DebugCanvasObject”))*.
Overriding ShouldTickIfViewportsOnly could make MyHud tick in editor, then finally use Draw2DLine drew some lines.
Above is so far I got.
But the line I drew just keep flashing, then I tried call Super::PostRender() in Tick and move drawing method to DrawHUD, still flashing and crashes editor.
I think it might be something with threading, since as my understanding, drawing methods are processed in different thread.
I found another interesting stuff, DrawDebugHelpers.cpp. I looked into it but failed to understand it. I don’t know where did
this actually draw these stuff, the only thing it did is add stuff to array and remove stuff when expired.
I’m still looking into it, any help would be appreciated.
:arrow_down::arrow_down::arrow_down:Now I’m just like​:arrow_down::arrow_down::arrow_down:
Programmer-cat-210x157.jpg