How to Destory the Dynamic Material Instance in memory?
I make a Dissolve Effect BP in my weapon when I destroy object it will have a dissolve effect, so... The dynamic material instance will not destroy together with the object and be there forever. How can I destroy the Dynamic Material Instance when it can not disappear? ![alt text] : /storage/temp/214743-dynamicmaterial1.png
asked Sep 26 '17 at 09:17 AM in Blueprint Scripting
Blueprints have a Garbage Collector. Any object that is no longer referenced in the world will be automatically destroyed (edit: I meant deleted). If you set the MaterialInstanceDynamic variable to null, the GC should kick in and remove it from memory.
I believe the system received a performance boost in 4.16 or 4.17, so this happens pretty quickly.
In your case, I'd set the parameter controlling the opacity of the effect to 0 and clear the referencing variable or destroy the actor that stores it.
Follow this question
Once you sign in you will be able to subscribe for any updates here