x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Spawn Actor in Function Library?

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,

Product Version: UE 4.12
Tags:
more ▼

asked Jun 11 '16 at 06:15 PM in Blueprint Scripting

avatar image

Arcade
38 7 12 12

avatar image vanditKing Jun 19 '16 at 06:11 AM

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...

avatar image Arcade Jun 19 '16 at 08:46 AM

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

avatar image Angel Tsvetkov Jul 11 '16 at 02:22 PM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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

more ▼

answered Jun 11 '16 at 07:05 PM

avatar image

IcemanX
133 4 6 10

avatar image Arcade Jun 11 '16 at 09:19 PM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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

more ▼

answered Mar 21 '17 at 03:32 PM

avatar image

Lucas-G-Farina
46 1 2 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question