# line trace not working when running project in headless mode using -nullrhi flag

**URL:** <https://forums.unrealengine.com/t/line-trace-not-working-when-running-project-in-headless-mode-using-nullrhi-flag/2474227>\
**Category:** C++\
**Tags:** line-trace, unreal-engine, CPP, question\
**Created:** [April 24, 2025, 4:26pm UTC](https://forums.unrealengine.com/t/line-trace-not-working-when-running-project-in-headless-mode-using-nullrhi-flag/2474227 "2025-04-24T16:26:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gwh0014](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gwh0014](https://forums.unrealengine.com/u/gwh0014)\
**Post date:** [April 24, 2025, 4:26pm UTC](https://forums.unrealengine.com/t/line-trace-not-working-when-running-project-in-headless-mode-using-nullrhi-flag/2474227/1 "2025-04-24T16:26:37Z")

</div>

I have a project set up where I am running rl agents down a track and i am using line trace to dynamically place spline points as the maps are loaded into the game during runtime. when i do this normally by just hitting play everything works as expected ,but unfortunately when i run the game in headless mode using the -nullrhi flag the line trace seems to be not detecting the boundaries of the road which are essentially invisible static meshes and i know the collisions for these meshes are working because when the agent passes over them it prints a statement that the agent passed said boundary. So is there a reason this line trace might not be working during headless mode?
