I am getting a crash when I spawn an actor with a geometry collection and switch the rest collection at runtime, but only with certain collections.
When a space ship explodes, it will spawn an actor that contains a geometry collection. The collection that is associated with the ship is passed as a parameter exposed on spawn, and the rest geometry is replaced OnBeginPlay for the spawned actor.
This works as intended, but I seem to have issues with certain collections I create. When testing one ship, it will crash with an array out of bounds error. I have recreated the geometry collection a few times and it keeps happening. If I switch the collection to the first one I created, it works. If I use this faulty geometry collection on my testing actor (Set in the editor, not replacing the rest collection at run time), it will not crash and the collection scatters as intended.
This leads me to believe the issue is when using Set Rest Collection, but since it is only with certain collections, I am wondering if the issue is setting the rest collection with a faulty geometry collection.
Is it possible I am doing something wrong when creating a geometry collection? I have 3 collections that do not cause a crash. Could there be something wrong with the static mesh itself that does not work with geometry collections?