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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Spawning Actor From Class with an Array is failing?

I am able to spawn any actor class I wish within this BluePrint if I simply click the purple Class dropdown and select an actor within the Spawn Actor from Class node.

Yet... if I add a basic "Get All Actors with Tag" to this BluePrint with said Actors being properly tagged - I am unable to spawn ANYTHING. Perhaps someone could see what I am doing wrong?

Thank you for your time.

Screenshot: https://imgur.com/a/hfcBI

Product Version: UE 4.17
Tags:
more ▼

asked Nov 29 '17 at 12:02 AM in Blueprint Scripting

avatar image

Ghoztt
1 2 4

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

1 answer: sort voted first

My guess is that you are fetching all 'current' actors with that tag. If you don't have any actors in that world with your tag, the array would return nothing.

What I would do is, do a ForEach loop on the returned array (get all actors with tag array) and pull the peg off and print the display name. This would show if you had any objects being returned for each tag you select.

Edit: Forgot to mention, if the array is returning nothing, try to drag that actor into the world and see if it's able to pull the reference.

more ▼

answered Nov 29 '17 at 12:14 AM

avatar image

Nice_Rain
249 13 14 30

avatar image Ghoztt Nov 29 '17 at 12:24 AM

Thank you, kindly. The function "Get All Actors with Tag" seems to only get currently spawned actors. Do you have any knowledge of how to pull from an array of actors (weapon pickups for a crate drop) without spawning all said weapons in the map?

Cheers!

avatar image Nice_Rain Nov 29 '17 at 12:31 AM

That's as I suspected. You would need to asynchronously load those items into the game: https://docs.unrealengine.com/latest/INT/Programming/Assets/AsyncLoading/index.html

If you don't mind having the memory taken up by these items (such as weapon pickups), you can create a 'Dictionary' in blueprints. For the 'Key', choose Name (FName in C++). For the reference, choose the subclass of Actor (purple peg). You can then use the dictionary variable, pass the name of the item (like the tag you used) and it will spit out the purple class peg. This can get default objects and spawn items within the world very easily.

(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