Spawn Actor in Function Library?
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?
asked Jun 11 '16 at 06:15 PM in Blueprint Scripting
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. :D
answered Jun 11 '16 at 07:05 PM
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
Follow this question
Once you sign in you will be able to subscribe for any updates here