Add 100 boxes via blueprints

I have a simple actor object called Box. I want 100 of them to appear in a certain segment. So I made another actor called Board.

Now is it possible for me to dynamically create the boxes via for loops?

I’m looking for something like an “Add actor” blueprint node. If this is not possible, what is standard practice for adding lots of objects?

EDIT: also would it be better/easier to do this via a widget and HUD popup or via actual actors ingame?

You have to

  • spawn an actor of type static mesh
  • Get the static mesh component from the actor
  • Set the static mesh to your cude

Thank you!!!

1st - In the Constuction Script you cannot use SpawnActorFromClass

Depends on how deep you want to control the stuff you may want to stick to actor but there’s a different way

You can add StaticMeshComponent on each Loop Iteration and you’re still able to control many things there and also as you create this node - you have all settings available as default without the need to add extra nodes afterwards

Remember to have a Vector Variable to set next location for the chunk

Here’s my lil unfinished room system as a teaser :stuck_out_tongue: It’s all done in Construction Script so I can see how it works without the need to start the project

Fantastic!! That is really helpful and good to know!!! I really like it!