# UE5: How to spawn Dynamic Mesh Component Actor Dynamically? 

**URL:** <https://forums.unrealengine.com/t/ue5-how-to-spawn-dynamic-mesh-component-actor-dynamically/2575656>\
**Category:** Blueprint\
**Tags:** unreal-engine, Blueprint, question\
**Created:** [June 25, 2025, 2:42pm UTC](https://forums.unrealengine.com/t/ue5-how-to-spawn-dynamic-mesh-component-actor-dynamically/2575656 "2025-06-25T14:42:56Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![baibaituan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@baibaituan](https://forums.unrealengine.com/u/baibaituan)\
**Post date:** [June 25, 2025, 2:42pm UTC](https://forums.unrealengine.com/t/ue5-how-to-spawn-dynamic-mesh-component-actor-dynamically/2575656/1 "2025-06-25T14:42:56Z")

</div>

I’ve created a DynamicMeshComponentActor Blueprint class BP\_DynamicCube that will generate a mesh when running the game if I drag it directly into the scene. But spawning this BP\_DynamicCube via SpawnActorFromClass will not see the generated mesh, but the IsValid return is success.  
I’m guessing it’s because the EventOnRebuildGenaratedMesh written in the BP\_DynamicCube isn’t executed when the SpawnActor spawns the BP\_DynamicCube, and therefore doesn’t get the TargetMesh. But how do I fix this?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/4/8/d4811541d457a82c7921abc804d9221360a404cd.jpeg)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/c/2/fc2a4b3cc7a97145d5f8e5aa0346acd1ef4511c3.jpeg)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/8/b/98b992c567c3d70b4ce23dacd71fd68824adc2ce.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/4/3/c43b671adb7cabaf7a9ab2c38cecf2e62cda07d7.jpeg)

---

<div class="post-metadata">

**Author:** ![Dasay2605](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dasay2605](https://forums.unrealengine.com/u/Dasay2605)\
**Post date:** [June 25, 2025, 3:01pm UTC](https://forums.unrealengine.com/t/ue5-how-to-spawn-dynamic-mesh-component-actor-dynamically/2575656/2 "2025-06-25T15:01:39Z")

</div>

You can get the `TargetMesh` directly from the `Dynamic Mesh component`, like this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/e/6/ae6b37a7a7b0ae99c280c0136110ff5a5f69f5c3.png)  
Then you probably don’t need to use a timer and `RebuildEvent` at all.

---

<div class="post-metadata">

**Author:** ![baibaituan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@baibaituan](https://forums.unrealengine.com/u/baibaituan)\
**Post date:** [June 25, 2025, 3:13pm UTC](https://forums.unrealengine.com/t/ue5-how-to-spawn-dynamic-mesh-component-actor-dynamically/2575656/3 "2025-06-25T15:13:33Z")

</div>

In fact, the eventOnRebuildGeneratedMesh is necessary, only the TargetMesh from it works(Conclusions reached after my tests)

---

<div class="post-metadata">

**Author:** ![baibaituan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@baibaituan](https://forums.unrealengine.com/u/baibaituan)\
**Post date:** [June 25, 2025, 3:15pm UTC](https://forums.unrealengine.com/t/ue5-how-to-spawn-dynamic-mesh-component-actor-dynamically/2575656/4 "2025-06-25T15:15:12Z")

</div>

Then the reason I used Timer was that I was trying to call its events/functions in the Blueprint that spawned this DynamicMesh

---

<div class="post-metadata">

**Author:** ![baibaituan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@baibaituan](https://forums.unrealengine.com/u/baibaituan)\
**Post date:** [June 25, 2025, 3:17pm UTC](https://forums.unrealengine.com/t/ue5-how-to-spawn-dynamic-mesh-component-actor-dynamically/2575656/5 "2025-06-25T15:17:32Z")

</div>

But I also can’t call its events/functions from the instance I get from the Spawner BP, which is pretty weird

---

<div class="post-metadata">

**Author:** ![Dasay2605](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dasay2605](https://forums.unrealengine.com/u/Dasay2605)\
**Post date:** [June 25, 2025, 4:05pm UTC](https://forums.unrealengine.com/t/ue5-how-to-spawn-dynamic-mesh-component-actor-dynamically/2575656/6 "2025-06-25T16:05:52Z")

</div>

That’s weird, the “Mesh” from `GetDynamicMesh` is the same thing you get from the `Rebuild` event. I’ve used that function before and it worked. In fact, I just tested the code and was able to see the cube that was created on the begin play event, so I don’t know why you couldn’t.

---

<div class="post-metadata">

**Author:** ![Dasay2605](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dasay2605](https://forums.unrealengine.com/u/Dasay2605)\
**Post date:** [June 25, 2025, 5:07pm UTC](https://forums.unrealengine.com/t/ue5-how-to-spawn-dynamic-mesh-component-actor-dynamically/2575656/7 "2025-06-25T17:07:56Z")

</div>

This is probably because **`Generated`** `Dynamic Mesh Actor` is an **Editor-only** class, so you won’t be able to call functions/events from other actors. In fact, I don’t think you should use this class at all. It probably won’t even exist in the packaged game due to that tag.

The `Dynamic Mesh Actor` class, its parent, is not an Editor-only class, so you should use that instead. It won’t have a `Rebuild` event though.

---

<div class="post-metadata">

**Author:** ![baibaituan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@baibaituan](https://forums.unrealengine.com/u/baibaituan)\
**Post date:** [June 26, 2025, 3:13am UTC](https://forums.unrealengine.com/t/ue5-how-to-spawn-dynamic-mesh-component-actor-dynamically/2575656/9 "2025-06-26T03:13:02Z")

</div>

Thanks for your help, think i solved some thing!  
By using the DynamicMeshActor instead of GeneratedDynaimcMeshActor, i can darg those actors into scene directlly, and they work normally!  
Now i’m try to SPAWN those things!

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/e/e/beeda799871fa196e1df891fa5d3f424af7e9510.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/4/6/3465e6e755d1c8798cd08f7d99f7e32ed62cd242.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/4/3/4439866a2ce8cadb8521d88aaf03aabed5e475d9.png)

---

<div class="post-metadata">

**Author:** ![baibaituan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@baibaituan](https://forums.unrealengine.com/u/baibaituan)\
**Post date:** [June 27, 2025, 8:51am UTC](https://forums.unrealengine.com/t/ue5-how-to-spawn-dynamic-mesh-component-actor-dynamically/2575656/10 "2025-06-27T08:51:09Z")

</div>

You’re amazing, you seem to have some research on DynamicMesh, can you please look at another question? This is about the performance optimization of dynamic meshes

# [UE5: Dynamic mesh actor optimize performance](https://forums.unrealengine.com/t/ue5-dynamic-mesh-actor-optimize-performance/2580722)
