# SetVectorParameterValue throws exception for UMaterialInstanceDynamic after load, called by a TimerManager managed timer.

**URL:** <https://forums.unrealengine.com/t/setvectorparametervalue-throws-exception-for-umaterialinstancedynamic-after-load-called-by-a-timermanager-managed-timer/433840>\
**Category:** Rendering\
**Tags:** exception, memory-management, timer, unreal-engine, question\
**Created:** [September 15, 2018, 6:23am UTC](https://forums.unrealengine.com/t/setvectorparametervalue-throws-exception-for-umaterialinstancedynamic-after-load-called-by-a-timermanager-managed-timer/433840 "2018-09-15T06:23:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![michaelzwm](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@michaelzwm](https://forums.unrealengine.com/u/michaelzwm)\
**Post date:** [September 15, 2018, 6:23am UTC](https://forums.unrealengine.com/t/setvectorparametervalue-throws-exception-for-umaterialinstancedynamic-after-load-called-by-a-timermanager-managed-timer/433840/1 "2018-09-15T06:23:17Z")

</div>

Weird thing is that if my UMaterialInstanceDynamic instance is instantiated in the same timer function, then call SetVectorParameterValue(…) succeeded, and I can see the material changed. However, after I add this variable as a class member, and init it in constructor but call it in timer function, it fails with the following exception.

 ![253766-ss-20180915112102.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/9/1/591563bf8abd1ed1c876c7cf99a87412c7f0aaa1.png)

Description:

1. exception message: Access violation reading location. 0xFFFFFFFFFFFFFFFF.

2. code line: Runtime\Core\Private\HAL\MallocTBB.cpp:106

3. Called by SetVectorParameterValue called of a UMaterialInstanceDynamic\* ptr which is initialized in the Actor’s constructor, and the material.

4. Upper call stack: TimerManager managed timer, call this function.

 ![253767-ss-20180915140050.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/2/9/82975fac93e86a7172022a9e8e43acfbe6579a04.png)

I have no idea what is wrong, any help?
