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

michaelzwm
Sat, 15 Sep 2018 06:23:17 +0000
Rendering

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.

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.

I have no idea what is wrong, any help?

1 post - 1 participant