# How can I SpawnActor in Thread?

**URL:** <https://forums.unrealengine.com/t/how-can-i-spawnactor-in-thread/421317>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [March 30, 2018, 10:50am UTC](https://forums.unrealengine.com/t/how-can-i-spawnactor-in-thread/421317 "2018-03-30T10:50:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Park0201](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Park0201](https://forums.unrealengine.com/u/Park0201)\
**Post date:** [March 30, 2018, 10:50am UTC](https://forums.unrealengine.com/t/how-can-i-spawnactor-in-thread/421317/1 "2018-03-30T10:50:41Z")

</div>

I tried std :: Thread and it says Crash.  
Is there another way?

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [March 30, 2018, 3:51pm UTC](https://forums.unrealengine.com/t/how-can-i-spawnactor-in-thread/421317/2 "2018-03-30T15:51:35Z")

</div>

Don’t use standard C++ library with UE4, aspecially in such sensitive matter as multi threading. UE4 provides it’s own implementation and you should use it so UE4 is aware of thread creation:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

But it might be still impossible to what you trying to do, UObjects should not be used else where then game thread, you most likely get crash with error informing you about it. You could make illusion of asynchronous spawns by doing that on tick when you green lit with some variables, you can also spread it across few frames if you thinking about performance. Explain your case, we might figure some alternatives.

---

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [October 29, 2024, 4:28am UTC](https://forums.unrealengine.com/t/how-can-i-spawnactor-in-thread/421317/3 "2024-10-29T04:28:52Z")

</div>

The thing is that every time you generate a projectile the FPS drops dramatically… imagine what happens in the middle of a battle. PS: I’m handling some UObjects within threads (I haven’t created them in the thread but I can read their properties)… so far I’ve only had problems with the garbage collector… but you can deactivate it and free the memory manually… I’d like to know if I can generate projectiles from a thread before writing code…
