# Static mesh component not showing up on spawned actor

**URL:** <https://forums.unrealengine.com/t/static-mesh-component-not-showing-up-on-spawned-actor/485040>\
**Category:** Asset Creation\
**Tags:** spawn-actor-from-cla, construction, static-mesh-disappea, unreal-engine, spawning-actors, question\
**Created:** [June 18, 2021, 1:56am UTC](https://forums.unrealengine.com/t/static-mesh-component-not-showing-up-on-spawned-actor/485040 "2021-06-18T01:56:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chase98999](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@chase98999](https://forums.unrealengine.com/u/chase98999)\
**Post date:** [June 18, 2021, 1:56am UTC](https://forums.unrealengine.com/t/static-mesh-component-not-showing-up-on-spawned-actor/485040/1 "2021-06-18T01:56:37Z")

</div>

I have a custom actor class called “BlackHole”, which is supposed to spawn a new actor of class “DarkMatter” after being in existence for 5 seconds. For some reason, when my black hole actor spawns my dark matter actor, the dark matter static mesh I have selected does not show up in-editor. However, I can see that the dark matter has indeed spawned (according to the world outliner). I’ve been trying to figure this out for days with no success, why is the static mesh component not showing up? Any help is appreciated, thank you.

BlackHole.h:

 ![341726-unrealhelp-bh-h.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/2/5/3253a0bca352ebecf30c0f98ff8a61d6ba14e757.png)

BlackHole.cpp:

 ![341727-unrealhelp-bh-cpp.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/3/9/439a6af60679d5715f026a66a59e22bf7d624a79.png)

DarkMatter.h:

![341728-unrealhelp-darkmatter-h.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/6/0/7608a16a094b68a69425d3d17d03e4da98cbca5a.png)

DarkMatter.cpp:

 ![341729-unrealhelp-darkmatter-cpp.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/a/e/1aee35abcfb94409c13d89c352524006c7d84fef.png)

This is the relevant code for the spawning implementation, mostly just the CreateDarkMatter function in BlackHole.cpp.

---

<div class="post-metadata">

**Author:** ![CtnDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ctndev/32/1133321_2.png) [@CtnDev](https://forums.unrealengine.com/u/CtnDev)\
**Post date:** [June 18, 2021, 8:31am UTC](https://forums.unrealengine.com/t/static-mesh-component-not-showing-up-on-spawned-actor/485040/2 "2021-06-18T08:31:29Z")

</div>

Yes, you set up your component **with defaults** but whats the **mesh of this component**?

> I can see that the dark matter has  
> indeed spawned (according to the world  
> outliner)

## Also if you press F3 you may see its collision component too. The thing is you did not setup visual mesh. 2 approach here :

## I pretty sure you have BP version of BlackHole. Create BP subclass of DarkMatter, assign a visual mesh to StaticMeshComponent. Then select ActorToSpawn in BlackHole BP as Dark Matter BP.

Second approach is fetch static mesh item to cpp via [FObjectFinder](https://docs.unrealengine.com/4.26/en-US/API/Runtime/CoreUObject/UObject/ConstructorHelpers/FObjectFinder/)   
  
then setup your static mesh with :

```
Mesh->SetStaticMesh(ref.object);

```

---

<div class="post-metadata">

**Author:** ![chase98999](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@chase98999](https://forums.unrealengine.com/u/chase98999)\
**Post date:** [June 18, 2021, 2:37pm UTC](https://forums.unrealengine.com/t/static-mesh-component-not-showing-up-on-spawned-actor/485040/3 "2021-06-18T14:37:19Z")

</div>

Thanks a bunch! I had already tried the first method before posting, with no success, but using the second approach fixed my issue.
