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"

How to spawn object while looping through all elements of a datatable?

I'm following a solution in this question for looping through row in a data table https://answers.unrealengine.com/questions/160783/is-there-a-better-way-to-loop-through-all-elements.html. It works perfectly.

My question would be how do i set it so that instead of printing the row name, it will spawn an actor/object for each row found? alt text

Product Version: UE 4.16
foreachloop.jpg (239.2 kB)
more ▼

asked Aug 11 '17 at 05:17 PM in Blueprint Scripting

avatar image

1 2 3

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

2 answers: sort voted first

Hi Bondhan.ARM,

I assume you want the data table to define what kind of actor to spawn. I would include the class name of the object you'd like to spawn in your data table (as type Actor Class Reference). Then that would appear in your Break Row node the same as Age/Gender/Job/Meshes in the screenshot you attached. You can plug that into a Spawn Actor from Class node and it will create the Actor from the Class Reference in your table.

more ▼

answered Aug 11 '17 at 06:38 PM

avatar image

116 2 6 8

avatar image Bondhan.ARM Aug 11 '17 at 08:22 PM

Hi rmcmurra, Thanks for the answer, but that's not quite what I'm after. I want it to spawn an actor for each row in a particular column. For instance if in the column 'job' there are 10 rows, then it will spawn 10 actor

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

With the Spawn Actor from Class node.

more ▼

answered Aug 12 '17 at 01:53 AM

avatar image

7k 143 28 172

(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