I’ve attached a screenshot of the section in the blueprint that is called before it happens. you can see there are a few validation checks before everything happens, and even a print sting to confirm the Variant index, set and target variant manager are all valid, however when it gets executed is when the game crashes.
And no, it’s not the same index, its confusingly random, this is why I’m so confused by it. It’s not like it happens in a specific order. The steps to reproduce are, change the variants a few times, leave the UI for around 30 seconds or so then start to change the UI again and after the first 2 tries it crashes again. I know for a fact it’s nothing to do with the UI as well, because I have a pixel stream input listener waiting for commands so I can change the variants through external web UI and the issue still persists then.
The variant manager only changes the material of the object it’s a product configurator of sorts. All the materials are material instances of a megascan asset, perhaps yes, I’ll try and remake it using different materials and see if that helps. I have two of these variant managers in the scene, one controls a HDRI sky by updating the material instance on the geometry to change the background and that never causes a crash.
And I’ve never used the garbage collection in UE before, however I did download UE from the source on GitHub and compile it then made a version of the project for c++ and it seems when I run the game in debug mode im getting a few errors in relation to texture streaming sometimes and I keep getting breakpoints in the materialinstance.cpp and whenever I go through the callstack it always seems to come from the MeshComponent.cpp in the SetMaterial function which is making me think its material related.
Thanks fro your help.