It is possible to draw 2D line in edit mode

Hi,
for my tool i want to draw rectangle on the viewport on the edit mode
i look for hours and nothing

it is simply possible ?
if yes … how :slight_smile: ?

Thank you for your help.

Best Regards
Daniel

DrawDebugHelpers.h what you are looking for. It has a few useful global functions.

// FlushPersistentDebugLines(GetWorld());
const FVector A = FVector(0.0f, 0.0f, 0.0f);
const FVector B = FVector(100.0f, 0.0f, 0.0f);
const FVector C = FVector(100.0f, 50.0f, 0.0f);
const FVector D = FVector(0.0f, 50.0f, 0.0f);
DrawDebugLine(GetWorld(), A, B, FColor::Purple, true, -1, 0, 5);
DrawDebugLine(GetWorld(), B, C, FColor::Purple, true, -1, 0, 5);
DrawDebugLine(GetWorld(), C, D, FColor::Purple, true, -1, 0, 5);
DrawDebugLine(GetWorld(), D, A, FColor::Purple, true, -1, 0, 5);