# Spawn Actor in Function Library?

**URL:** <https://forums.unrealengine.com/t/spawn-actor-in-function-library/360453>\
**Category:** Blueprint\
**Tags:** spawn, function-library, unreal-engine, question\
**Created:** [June 11, 2016, 6:15pm UTC](https://forums.unrealengine.com/t/spawn-actor-in-function-library/360453 "2016-06-11T18:15:36Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arcade](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Arcade](https://forums.unrealengine.com/u/Arcade)\
**Post date:** [June 11, 2016, 6:15pm UTC](https://forums.unrealengine.com/t/spawn-actor-in-function-library/360453/1 "2016-06-11T18:15:36Z")

</div>

Hi,

It doesn’t seem to be possible to use the Spawn Actor of Class BP-node in functions that are in a Function Library asset.

I’m sure there’s some logic behind this, but I’m curious as to find out what?

Thanks,

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_fd498a211](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fd498a211](https://forums.unrealengine.com/u/anonymous_user_fd498a211)\
**Post date:** [June 11, 2016, 7:05pm UTC](https://forums.unrealengine.com/t/spawn-actor-in-function-library/360453/2 "2016-06-11T19:05:57Z")

</div>

I’m not at my computer right now, so I’m working from memory/guessing, but it’s probably because anything can use a function library, and not all objects could spawn an actor, like widgets, etc. I can update this when I have a better explanation. 😃

---

<div class="post-metadata">

**Author:** ![Arcade](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Arcade](https://forums.unrealengine.com/u/Arcade)\
**Post date:** [June 11, 2016, 9:19pm UTC](https://forums.unrealengine.com/t/spawn-actor-in-function-library/360453/3 "2016-06-11T21:19:08Z")

</div>

Oh! Hm, I’ll experiment with some casting then. Thanks

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_1111614c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_1111614c](https://forums.unrealengine.com/u/anonymous_user_1111614c)\
**Post date:** [June 19, 2016, 6:11am UTC](https://forums.unrealengine.com/t/spawn-actor-in-function-library/360453/4 "2016-06-19T06:11:50Z")

</div>

i have same problem. my old func\_lib have spawn actor from class. but i cannot make new func to spawn actor from class. cannot find that node anymore…

---

<div class="post-metadata">

**Author:** ![Arcade](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Arcade](https://forums.unrealengine.com/u/Arcade)\
**Post date:** [June 19, 2016, 8:46am UTC](https://forums.unrealengine.com/t/spawn-actor-in-function-library/360453/5 "2016-06-19T08:46:00Z")

</div>

I ended up creating a macro in a macro library instead.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3149ac211](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3149ac211](https://forums.unrealengine.com/u/anonymous_user_3149ac211)\
**Post date:** [July 11, 2016, 2:22pm UTC](https://forums.unrealengine.com/t/spawn-actor-in-function-library/360453/6 "2016-07-11T14:22:50Z")

</div>

Same problem here in 4.11. There is no Spawn Actor node in Blueprint Function Library

---

<div class="post-metadata">

**Author:** ![Lucas-G-Farina](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lucas-G-Farina](https://forums.unrealengine.com/u/Lucas-G-Farina)\
**Post date:** [March 21, 2017, 3:32pm UTC](https://forums.unrealengine.com/t/spawn-actor-in-function-library/360453/7 "2017-03-21T15:32:48Z")

</div>

Don’t take it as absolutely true, I may be wrong on this, but I’m pretty sure this isn’t a bug:

This might be because spawn node is somewhat latent… And functions can not be latent, they must end their functionality within the same tick… Besides, it needs to be sure the object you are calling the spawn from is on the level (actor) to spawn another actor. It takes the level in implicit reference.

But do not despair, one way around it is to implement a Spawn Actor event either on GameInstance or GameMode, and then call it on the FunctionLibrary, this way you can still spawn from function by delegating the spawn functionality to one of these sure-to-be-in-level classes

---

<div class="post-metadata">

**Author:** ![normal\_ST](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@normal\_ST](https://forums.unrealengine.com/u/normal_ST)\
**Post date:** [November 21, 2022, 3:21am UTC](https://forums.unrealengine.com/t/spawn-actor-in-function-library/360453/8 "2022-11-21T03:21:03Z")

</div>

Not sure if there is any other solution to this, but this is genius!

My setup(I left one temporary variable for future, to pass some extra info if needed as message to spawned actor):

 ![GameInstanceFunc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/7/0/77079870d25c15eb79555e075d571869d7ba5a1b.jpeg)  
 ![BPFL_Func](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/f/1/9f1c924414f8576a9dd89ce4d668ab4954c7ccb8.jpeg)

---

<div class="post-metadata">

**Author:** ![TorQueMoD](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/torquemod/32/710746_2.png) [@TorQueMoD](https://forums.unrealengine.com/u/TorQueMoD)\
**Post date:** [April 11, 2023, 7:57am UTC](https://forums.unrealengine.com/t/spawn-actor-in-function-library/360453/9 "2023-04-11T07:57:48Z")

</div>

While you can’t use Spawn Actor From Class inside a Function Library, what you can do is create the function inside your player character and then reference that function through your Function Library as a passthrough (IE create the same function inside your library and call the function on the player character to execute). The only advantage really is the quick accessibility of a Function Library. Otherwise, you can just call the function from your player character.
