Particle system material garbage collected
There has been a very annoying bug in the packaged version of my game where it would occasionally crash due to random particle system component related code. Today I luckily ran into the crash while debugging (DebugGame config) and got a helpful crash log. The output informed me that a material of a particle system required module was invalid.
So I figured the reason for this must be that the material is garbage collected for some reason. I am dynamically loading the particle system during the game with this code:
So I added this code as a workaround and it seems to have fixed the issue:
Although the workaround seems to be working, it's not a nice solution so I would be glad to hear the reason why it didn't not work in the first place. Am I missing something? Shouldn't it be enough to add the particle system to the root?
asked Nov 27 '16 at 08:03 PM in C++ Programming
Could it be that it gets collected as garbage because your particle system does not have an outer when it gets created? LoadObject(NULL, *AssetPath);
Maybe if you put the outer to the right UWorld it will not get collected as garbage. I also ran into similar problems like this and was able to solve it this way.
Hope this helps :)
answered Nov 28 '16 at 11:34 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here