# Creating Dynamic Material in Construct Script crashes engine at reload

**URL:** <https://forums.unrealengine.com/t/creating-dynamic-material-in-construct-script-crashes-engine-at-reload/376988>\
**Category:** Rendering\
**Tags:** unreal-engine, crash, construction-script, question\
**Created:** [November 21, 2016, 10:46am UTC](https://forums.unrealengine.com/t/creating-dynamic-material-in-construct-script-crashes-engine-at-reload/376988 "2016-11-21T10:46:34Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![KennyTeo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KennyTeo](https://forums.unrealengine.com/u/KennyTeo)\
**Post date:** [June 15, 2024, 12:13pm UTC](https://forums.unrealengine.com/t/creating-dynamic-material-in-construct-script-crashes-engine-at-reload/376988/4 "2024-06-15T12:13:22Z")

</div>

Heya

Just to check, did you solution work for you 100% of the time?

My issue is closer to this:

> [@Engine crashes when stop simulating while a dynamic material instance is being set to a sprite component](https://forums.unrealengine.com/t/engine-crashes-when-stop-simulating-while-a-dynamic-material-instance-is-being-set-to-a-sprite-component/1399441):
>
> Hello, I’m using UE 5.3.2 and I’m experiencing an issue in which if you stop simulating (press ESC), while set a parameter of a dynamic material instance in event tick (or in a timeline, or quick timer), the engine crashes, here is the log (with symbols installed): Assertion failed: Index\>=0 && Index\<NumBits [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Containers\BitArray.h] [Line: 1418] UnrealEditor\_Core!FOutputDeviceRedirector::Panic() [D:\build\++UE5\Sync\Engine\Source\Runtim…

Its pretty much a crash that is caused by Dynamic Material Instance, that happens when you ESC from the simulation.  
However, I could not find a solution yet, so I am trying your solution, even if the situation is slightly different.

Anyways, the solution did not help my situation so I was wondering if I am doing it right, of if the solution works at all. Any info will be helpful.

---

_[View the full topic](https://forums.unrealengine.com/t/creating-dynamic-material-in-construct-script-crashes-engine-at-reload/376988)._
