# DrawDebugBox bug (lines do not dissapear)

**URL:** <https://forums.unrealengine.com/t/drawdebugbox-bug-lines-do-not-dissapear/2695007>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [January 26, 2026, 2:32pm UTC](https://forums.unrealengine.com/t/drawdebugbox-bug-lines-do-not-dissapear/2695007 "2026-01-26T14:32:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Youshisu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Youshisu](https://forums.unrealengine.com/u/Youshisu)\
**Post date:** [January 26, 2026, 2:32pm UTC](https://forums.unrealengine.com/t/drawdebugbox-bug-lines-do-not-dissapear/2695007/1 "2026-01-26T14:32:22Z")

</div>

For some reason, I can’t remove debug lines in Editor.

They persist in editor. I even changed colors and recompiled code with live coding or restarted editor.

I call this funciton with CallInBluePrint

```cpp
DrawDebugBox(
    world,
    locationIn,
    paramsIn.DebugParams.DebugBoxSize / 2,
    rotationIn,
    FColor::Purple,
    false,
    // paramsIn.DebugParams.DisplayTime,
    1.f, /* LifeTime */
    0, /* Depth */
    2.f /* Thick */
);

```

Only manual flushing works.

```cpp
FlushPersistentDebugLines(world);

```

 ![obraz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/f/f/fff8382b55c6df340970fe29da395ee48a097d75.jpeg)

Other symptoms of invalid world was.

I could not snap actors to ground.

Overlap functions would not detect collision or query any `Overlap` or `Trace` functions.  
So my collisions were always false and nothing was detected.

---

<div class="post-metadata">

**Author:** ![Youshisu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Youshisu](https://forums.unrealengine.com/u/Youshisu)\
**Post date:** [January 26, 2026, 4:41pm UTC](https://forums.unrealengine.com/t/drawdebugbox-bug-lines-do-not-dissapear/2695007/2 "2026-01-26T16:41:28Z")

</div>

I found the issue. In my case.

Problem was Level automatically loaded by Editor.  
After switching level to other and back everything worked again!

Snap workded.  
Collision worked.  
Drawing non persistent lines too.
