# Spawn and set GeometryCollection initialization fields at runtime

**URL:** <https://forums.unrealengine.com/t/spawn-and-set-geometrycollection-initialization-fields-at-runtime/527359>\
**Category:** Blueprint\
**Tags:** unreal-engine, UE5-0, Blueprint, question\
**Created:** [April 13, 2022, 4:47pm UTC](https://forums.unrealengine.com/t/spawn-and-set-geometrycollection-initialization-fields-at-runtime/527359 "2022-04-13T16:47:47Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cheesefrycook](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cheesefrycook](https://forums.unrealengine.com/u/Cheesefrycook)\
**Post date:** [April 13, 2022, 4:47pm UTC](https://forums.unrealengine.com/t/spawn-and-set-geometrycollection-initialization-fields-at-runtime/527359/1 "2022-04-13T16:47:47Z")

</div>

Here is my component view:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/6/b/26bb5ddcf337c6ee3978fe97d65c6e7021bcd521.png)

The child actor above is just a FS\_AnchorField\_Generic.

I’m calling this simple event in my construction script:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/e/a/7ea4def77c56a821fcaa79c46e06f29784aa1348.png)

If I place the actor in the level, it works fine. However if I try to spawn the actor during play, the anchor field is not set and the GeometryCollection falls to the ground.

Any ideas?

---

<div class="post-metadata">

**Author:** ![Bent\_Vector](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bent_vector/32/1217513_2.png) [@Bent\_Vector](https://forums.unrealengine.com/u/Bent_Vector)\
**Post date:** [May 18, 2022, 1:43pm UTC](https://forums.unrealengine.com/t/spawn-and-set-geometrycollection-initialization-fields-at-runtime/527359/2 "2022-05-18T13:43:50Z")

</div>

Did you ever solve this? I believe initialization fields must be set in the constructor, but I’m having the same problem.

---

<div class="post-metadata">

**Author:** ![AncientArtifact](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ancientartifact/32/464847_2.png) [@AncientArtifact](https://forums.unrealengine.com/u/AncientArtifact)\
**Post date:** [May 28, 2022, 10:32am UTC](https://forums.unrealengine.com/t/spawn-and-set-geometrycollection-initialization-fields-at-runtime/527359/3 "2022-05-28T10:32:21Z")

</div>

Having the same issue lol we must seek an expert

---

<div class="post-metadata">

**Author:** ![Bent\_Vector](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bent_vector/32/1217513_2.png) [@Bent\_Vector](https://forums.unrealengine.com/u/Bent_Vector)\
**Post date:** [May 28, 2022, 10:27pm UTC](https://forums.unrealengine.com/t/spawn-and-set-geometrycollection-initialization-fields-at-runtime/527359/4 "2022-05-28T22:27:34Z")

</div>

I suspect it cannot be done in Blueprints, likely due to interactions between Chaos and other actors. I think I saw a post about somebody doing it in C++, but now I cannot find it!

---

<div class="post-metadata">

**Author:** ![AncientArtifact](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ancientartifact/32/464847_2.png) [@AncientArtifact](https://forums.unrealengine.com/u/AncientArtifact)\
**Post date:** [May 30, 2022, 1:51pm UTC](https://forums.unrealengine.com/t/spawn-and-set-geometrycollection-initialization-fields-at-runtime/527359/5 "2022-05-30T13:51:27Z")

</div>

it certainly can be done in BP but i think the idea seems like it didn’t cross the mind of whoever is in charge of this side of the engine

---

<div class="post-metadata">

**Author:** ![Bent\_Vector](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bent_vector/32/1217513_2.png) [@Bent\_Vector](https://forums.unrealengine.com/u/Bent_Vector)\
**Post date:** [May 30, 2022, 3:34pm UTC](https://forums.unrealengine.com/t/spawn-and-set-geometrycollection-initialization-fields-at-runtime/527359/6 "2022-05-30T15:34:19Z")

</div>

Let me rephrase that. I don’t think it can currently be done in blueprints without some further changes from epic

---

<div class="post-metadata">

**Author:** ![ViceroyD1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ViceroyD1](https://forums.unrealengine.com/u/ViceroyD1)\
**Post date:** [July 2, 2022, 7:00am UTC](https://forums.unrealengine.com/t/spawn-and-set-geometrycollection-initialization-fields-at-runtime/527359/7 "2022-07-02T07:00:24Z")

</div>

Apparently, it can be done in C++. I think I understand what this person is doing except for the ‘header file’ part.

[Dynamic Anchor Fields? - Chaos : unrealengine (reddit.com)](https://www.reddit.com/r/unrealengine/comments/sybtfb/dynamic_anchor_fields_chaos/)

---

<div class="post-metadata">

**Author:** ![SumoDaveRose](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SumoDaveRose](https://forums.unrealengine.com/u/SumoDaveRose)\
**Post date:** [October 9, 2022, 9:35am UTC](https://forums.unrealengine.com/t/spawn-and-set-geometrycollection-initialization-fields-at-runtime/527359/8 "2022-10-09T09:35:52Z")

</div>

Hi there, I don’t have a solution sorry but I would like to try what you have here in the construction script! Im stuck at the first part though and I can’t find the ‘clear initialization Fields’ node or the the ‘Add Initialization Field’ node. All help would be appreciated!  
Cheers

---

<div class="post-metadata">

**Author:** ![Resolve](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Resolve](https://forums.unrealengine.com/u/Resolve)\
**Post date:** [January 28, 2023, 4:48am UTC](https://forums.unrealengine.com/t/spawn-and-set-geometrycollection-initialization-fields-at-runtime/527359/9 "2023-01-28T04:48:13Z")

</div>

Did you ever figure this out?

---

<div class="post-metadata">

**Author:** ![AncientArtifact](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ancientartifact/32/464847_2.png) [@AncientArtifact](https://forums.unrealengine.com/u/AncientArtifact)\
**Post date:** [February 8, 2023, 1:10pm UTC](https://forums.unrealengine.com/t/spawn-and-set-geometrycollection-initialization-fields-at-runtime/527359/10 "2023-02-08T13:10:44Z")

</div>

OK so for my project what i did is  
Add geometry collection component  
set the mesh  
then disable physics.  
add a box collision around the GC and when overlapped it enables physics.  
now this might not work if you want to partially destroy a mesh.  
but for destroying a whole mesh it’s flawless.

---

<div class="post-metadata">

**Author:** ![TheWolf](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/thewolf/32/1036665_2.png) [@TheWolf](https://forums.unrealengine.com/u/TheWolf)\
**Post date:** [March 13, 2023, 7:39am UTC](https://forums.unrealengine.com/t/spawn-and-set-geometrycollection-initialization-fields-at-runtime/527359/11 "2023-03-13T07:39:14Z")

</div>

Anyone know if the Initialization nodes (Add Initialization Field, clear Initialization Fields) have been removed in 5.1.1? I don’t see them.

---

<div class="post-metadata">

**Author:** ![Frakatchoo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/frakatchoo/32/1060026_2.png) [@Frakatchoo](https://forums.unrealengine.com/u/Frakatchoo)\
**Post date:** [April 26, 2023, 11:00pm UTC](https://forums.unrealengine.com/t/spawn-and-set-geometrycollection-initialization-fields-at-runtime/527359/12 "2023-04-26T23:00:23Z")

</div>

Try this :

 ![Capture d’écran (84)](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/6/c/96c2d2aac15cfb774c323cb67d3de52106d263bd.png)

---

<div class="post-metadata">

**Author:** ![SireFuzzywig](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sirefuzzywig/32/489246_2.png) [@SireFuzzywig](https://forums.unrealengine.com/u/SireFuzzywig)\
**Post date:** [May 2, 2023, 10:09pm UTC](https://forums.unrealengine.com/t/spawn-and-set-geometrycollection-initialization-fields-at-runtime/527359/14 "2023-05-02T22:09:25Z")

</div>

This works for me when the blueprint is placed in the world, but does not work when that same blueprint is spawned into the world.

Have you had any luck making anchor fields work within spawned blueprints?

---

<div class="post-metadata">

**Author:** ![Viper312005](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Viper312005](https://forums.unrealengine.com/u/Viper312005)\
**Post date:** [May 24, 2023, 4:14am UTC](https://forums.unrealengine.com/t/spawn-and-set-geometrycollection-initialization-fields-at-runtime/527359/15 "2023-05-24T04:14:47Z")

</div>

So, I’ve been having the same issue. Anchors work if the BP Is already in the level, but doesn’t when I try to spawn. I was able to get it to work though. Make sure Physics is turned off on the GC in your BP. Then add a delay in the BeginPlay node and Set Simulate Physics to true. This worked for me, not sure if it will for anybody else.

---

<div class="post-metadata">

**Author:** ![AferMann](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AferMann](https://forums.unrealengine.com/u/AferMann)\
**Post date:** [May 30, 2023, 4:49am UTC](https://forums.unrealengine.com/t/spawn-and-set-geometrycollection-initialization-fields-at-runtime/527359/16 "2023-05-30T04:49:18Z")

</div>

This worked for me, thanks! I didn’t even need to set a delay, just set the physics flag after creating the anchor.

---

<div class="post-metadata">

**Author:** ![ashtorak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ashtorak/32/870614_2.png) [@ashtorak](https://forums.unrealengine.com/u/ashtorak)\
**Post date:** [August 12, 2023, 3:25pm UTC](https://forums.unrealengine.com/t/spawn-and-set-geometrycollection-initialization-fields-at-runtime/527359/17 "2023-08-12T15:25:02Z")

</div>

So spawning it at actual runtime for example if you want to respawn it, so well after beginplay and then attaching the anchor field is not possible right now? Or is there another way to respawn or reset an existing collection?

---

<div class="post-metadata">

**Author:** ![Luna2442](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Luna2442](https://forums.unrealengine.com/u/Luna2442)\
**Post date:** [September 27, 2023, 4:38pm UTC](https://forums.unrealengine.com/t/spawn-and-set-geometrycollection-initialization-fields-at-runtime/527359/18 "2023-09-27T16:38:20Z")

</div>

So thanks to this hint I got it working for myself. I have BPs of GCs that I wanted to be able to reuse freely. I created box collisions in my BP that serve as points to spawn in anchors points. In the construction script, I loop over each geometry collection component and turn off the physics, then on begin play I loop over each box trigger, spawn an anchor point of the same size, add those new anchors to each GC, and reenable the physics for each GC.

---

<div class="post-metadata">

**Author:** ![Beacon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Beacon](https://forums.unrealengine.com/u/Beacon)\
**Post date:** [October 21, 2023, 12:21pm UTC](https://forums.unrealengine.com/t/spawn-and-set-geometrycollection-initialization-fields-at-runtime/527359/19 "2023-10-21T12:21:28Z")

</div>

Thanks folks, this solved it for me too, very helpful!

---

<div class="post-metadata">

**Author:** ![perochialjoe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@perochialjoe](https://forums.unrealengine.com/u/perochialjoe)\
**Post date:** [January 21, 2024, 2:31am UTC](https://forums.unrealengine.com/t/spawn-and-set-geometrycollection-initialization-fields-at-runtime/527359/20 "2024-01-21T02:31:08Z")

</div>

Just a heads up for anybody still messing around with this: For me it wasn’t enough to disable physics in the Construction Script. I had to disable it on the Geometry Collection itself and then enable it later in the blueprint. After that, Luna2442’s post worked.

---

<div class="post-metadata">

**Author:** ![nullmorpheme](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@nullmorpheme](https://forums.unrealengine.com/u/nullmorpheme)\
**Post date:** [March 27, 2024, 9:46am UTC](https://forums.unrealengine.com/t/spawn-and-set-geometrycollection-initialization-fields-at-runtime/527359/21 "2024-03-27T09:46:18Z")

</div>

My Editor freezes when turnin simulation back on ((

[Next page](https://forums.unrealengine.com/t/spawn-and-set-geometrycollection-initialization-fields-at-runtime/527359.md?page=2)
