# Unreal Crashes on VR Preview every second time

**URL:** <https://forums.unrealengine.com/t/unreal-crashes-on-vr-preview-every-second-time/415906>\
**Category:** XR Development\
**Tags:** editor-crash, unreal-engine, crash, bug-report, editor, question\
**Created:** [January 30, 2018, 12:19pm UTC](https://forums.unrealengine.com/t/unreal-crashes-on-vr-preview-every-second-time/415906 "2018-01-30T12:19:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![CactusFantastico](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CactusFantastico](https://forums.unrealengine.com/u/CactusFantastico)\
**Post date:** [January 30, 2018, 12:19pm UTC](https://forums.unrealengine.com/t/unreal-crashes-on-vr-preview-every-second-time/415906/1 "2018-01-30T12:19:17Z")

</div>

Hi everyone,

for some reason with my new project I’m working on at the moment, i’ve found it will run the VR Preview the first time no problem, but when I go to run it a second time it crashes. After it’s reopened the project it will once again work the first time but crash the second.

Here is the error it says when it crashes:

```
LoginId:7b3d65d447d54cfbd0062c99a868f615
EpicAccountId:de923e77ec9c4c6e8e302f1482ba8b43

Assertion failed: !bClearColor || NumClearColors >= BoundRenderTargets.GetNumActiveTargets() [File:D:\Build\++UE4+Release-4.18+Compile\Sync\Engine\Source\Runtime\Windows\D3D11RHI\Private\D3D11Commands.cpp] [Line: 1823]

UE4Editor_Core!FDebug::AssertFailed() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:414]
UE4Editor_D3D11RHI!FD3D11DynamicRHI::RHIClearMRTImpl() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\windows\d3d11rhi\private\d3d11commands.cpp:1823]
UE4Editor_D3D11RHI!FD3D11DynamicRHI::RHISetRenderTargetsAndClear() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\windows\d3d11rhi\private\d3d11commands.cpp:1204]
UE4Editor_Renderer!FSceneRenderer::RenderDistortion() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\renderer\private\distortionrendering.cpp:1077]
UE4Editor_Renderer!FDeferredShadingSceneRenderer::Render() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\renderer\private\deferredshadingrenderer.cpp:1277]
UE4Editor_Renderer!CaptureSceneToScratchCubemap() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\renderer\private\reflectionenvironmentcapture.cpp:728]
UE4Editor_Renderer!TGraphTask<`CaptureSceneIntoScratchCubemap'::`4'::EURCMacro_CaptureCommand>::ExecuteTask() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\core\public\async\taskgraphinterfaces.h:784]
UE4Editor_Core!FNamedTaskThread::ProcessTasksNamedThread() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\core\private\async\taskgraph.cpp:651]
UE4Editor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\core\private\async\taskgraph.cpp:560]
UE4Editor_RenderCore!RenderingThreadMain() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\rendercore\private\renderingthread.cpp:327]
UE4Editor_RenderCore!FRenderingThread::Run() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\rendercore\private\renderingthread.cpp:461]
UE4Editor_Core!FRunnableThreadWin::Run() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:76]
```

---

<div class="post-metadata">

**Author:** ![eXi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/exi/32/906583_2.png) [@eXi](https://forums.unrealengine.com/u/eXi)\
**Post date:** [February 6, 2018, 3:24pm UTC](https://forums.unrealengine.com/t/unreal-crashes-on-vr-preview-every-second-time/415906/2 "2018-02-06T15:24:26Z")

</div>

(Can’t put this into a comment due to character limit)

Seems like I ran into a similar issue with 4.18.3, Oculus and a Render Target.  
When spawning a CameraMesh that has a RenderTarget attached, it will crash with this log:

```
Assertion failed: !bClearColor || NumClearColors >= BoundRenderTargets.GetNumActiveTargets() [File:D:\Build\++UE4+Release-4.18+Compile\Sync\Engine\Source\Runtime\Windows\D3D11RHI\Private\D3D11Commands.cpp] [Line: 1823]
    
    UE4Editor_Core!FDebug::AssertFailed() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:414]
    UE4Editor_D3D11RHI!FD3D11DynamicRHI::RHIClearMRTImpl() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\windows\d3d11rhi\private\d3d11commands.cpp:1823]
    UE4Editor_D3D11RHI!FD3D11DynamicRHI::RHISetRenderTargetsAndClear() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\windows\d3d11rhi\private\d3d11commands.cpp:1204]
    UE4Editor_Renderer!SetRenderTarget() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\rhi\public\rhiutilities.h:405]
    UE4Editor_Renderer!FDeferredShadingSceneRenderer::RenderLights() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\renderer\private\lightrendering.cpp:607]
    UE4Editor_Renderer!FDeferredShadingSceneRenderer::Render() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\renderer\private\deferredshadingrenderer.cpp:1131]
    UE4Editor_Renderer!UpdateSceneCaptureContentDeferred_RenderThread() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\renderer\private\scenecapturerendering.cpp:263]
    UE4Editor_Renderer!UpdateSceneCaptureContent_RenderThread() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\renderer\private\scenecapturerendering.cpp:306]
    UE4Editor_Renderer!TEnqueueUniqueRenderCommandType<`FScene::UpdateSceneCaptureContents'::`12'::CaptureCommandName,<lambda_9b14fd344d5e45a845844385591b130e> >::DoTask() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\rendercore\public\renderingthread.h:190]
    UE4Editor_Renderer!TGraphTask<TEnqueueUniqueRenderCommandType<`FScene::UpdateSceneCaptureContents'::`12'::CaptureCommandName,<lambda_9b14fd344d5e45a845844385591b130e> > >::ExecuteTask() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\core\public\async\taskgraphinterfaces.h:784]
    UE4Editor_Core!FNamedTaskThread::ProcessTasksNamedThread() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\core\private\async\taskgraph.cpp:651]
    UE4Editor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\core\private\async\taskgraph.cpp:560]
    UE4Editor_RenderCore!RenderingThreadMain() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\rendercore\private\renderingthread.cpp:327]
    UE4Editor_RenderCore!FRenderingThread::Run() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\rendercore\private\renderingthread.cpp:461]
    UE4Editor_Core!FRunnableThreadWin::Run() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:76]

```

Seems like the exact same crash. Are you doing anything regarding additional screens/render targets in your project?

---

<div class="post-metadata">

**Author:** ![CactusFantastico](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CactusFantastico](https://forums.unrealengine.com/u/CactusFantastico)\
**Post date:** [February 6, 2018, 3:29pm UTC](https://forums.unrealengine.com/t/unreal-crashes-on-vr-preview-every-second-time/415906/3 "2018-02-06T15:29:10Z")

</div>

Strangely I am not, I have since found what makes it crash like this but still not why.

I found that If I removed the Light Scenario I had then it would be fixed. I had a simple Day and Night Light Scenarios. When I removed them and baked normally it runs and compiles fine.

Now why this worked I have not a clue

---

<div class="post-metadata">

**Author:** ![Constantin\_Suman](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Constantin\_Suman](https://forums.unrealengine.com/u/Constantin_Suman)\
**Post date:** [April 20, 2018, 10:23am UTC](https://forums.unrealengine.com/t/unreal-crashes-on-vr-preview-every-second-time/415906/4 "2018-04-20T10:23:07Z")

</div>

Similarly, my Unreal Editor (v4.19) was crashing when running VR Preview every 2nd time.

Issue:

The source of the issue, in my case, was having in the “Project Settings” the “Default Game Mode” set to a game mode which was used for the default game level in multiplayer environment, meaning it was trying to set up a server/client environment.

Solution:

Edit “DefaultEngine.ini” and modify the line “GlobalDefaultGameMode=[yourGameMode]” to “GlobalDefaultGameMode=None”, or whichever other game mode which would not crash the VR-Preview.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_c293fb78](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c293fb78](https://forums.unrealengine.com/u/anonymous_user_c293fb78)\
**Post date:** [November 29, 2018, 4:36pm UTC](https://forums.unrealengine.com/t/unreal-crashes-on-vr-preview-every-second-time/415906/5 "2018-11-29T16:36:34Z")

</div>

Hello,  
Today I packaged a heavy game and the “second” time that I wanted to run it it crashed. (D3D error)  
My only option was to restart my PC. Then again, I could only open it once till I restarted the machine again.

Then I realized if I exit epic games on the “system tray” I can run my game for as many times as I want without having to restart my computer. cheers.

Hope it helps you too.

---

<div class="post-metadata">

**Author:** ![Constantin\_Suman](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Constantin\_Suman](https://forums.unrealengine.com/u/Constantin_Suman)\
**Post date:** [December 4, 2018, 3:05pm UTC](https://forums.unrealengine.com/t/unreal-crashes-on-vr-preview-every-second-time/415906/6 "2018-12-04T15:05:46Z")

</div>

Your comment is out of scope.

---

<div class="post-metadata">

**Author:** ![oshevoshev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@oshevoshev](https://forums.unrealengine.com/u/oshevoshev)\
**Post date:** [January 11, 2025, 4:01pm UTC](https://forums.unrealengine.com/t/unreal-crashes-on-vr-preview-every-second-time/415906/7 "2025-01-11T16:01:42Z")

</div>

> [@anonymous\_user\_c293fb78](#):
>
> exit epic games on the “system tray”

This didn’t work for me.

---

<div class="post-metadata">

**Author:** ![oshevoshev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@oshevoshev](https://forums.unrealengine.com/u/oshevoshev)\
**Post date:** [January 11, 2025, 4:03pm UTC](https://forums.unrealengine.com/t/unreal-crashes-on-vr-preview-every-second-time/415906/8 "2025-01-11T16:03:09Z")

</div>

> [@Constantin\_Suman](#):
>
> Edit “DefaultEngine.ini” and modify the line “GlobalDefaultGameMode=[yourGameMode]” to “GlobalDefaultGameMode=None”, or whichever other game mode which would not crash the VR-Preview.

I already have VR Preview game mode there. Strangely, I set it to None before starting the editor. Then started the editor, set the VR Preview mode and then it worked during that session, no crashes. I tried to do the same way again later - no luck. Still crashes.
