# Crashing problems when replacing geometry collection at runtime

**URL:** <https://forums.unrealengine.com/t/crashing-problems-when-replacing-geometry-collection-at-runtime/2429665>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, geometry, question, Blueprint\
**Created:** [March 30, 2025, 6:18pm UTC](https://forums.unrealengine.com/t/crashing-problems-when-replacing-geometry-collection-at-runtime/2429665 "2025-03-30T18:18:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Great\_Elector1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Great\_Elector1](https://forums.unrealengine.com/u/Great_Elector1)\
**Post date:** [March 30, 2025, 6:18pm UTC](https://forums.unrealengine.com/t/crashing-problems-when-replacing-geometry-collection-at-runtime/2429665/1 "2025-03-30T18:18:05Z")

</div>

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?
