spawn actor

I want to automatically spawn a box behind a box. For this, I created an actor class and added arrow, then I entered the following code into the actor’s event graph, but when I run it this way, the first box continues to produce boxes after it and nested boxes start to form. what should I do?

1 Like

Have an integer in the box BP. Set it to the number of boxes you want. Each time you spawn a new box, pass it the integer - 1. When it gets to 0, don’t spawn any more boxes :slight_smile:

There are 12 boxes on this screen. The problem is not how many boxes are formed in a row. Since I ran the spawn code inside the actor, the rightmost box creates a box behind it during the second run.

Your code wasn’t up there before.

Delay doesn’t do anything on tick. It’s much easier to make a blueprint with this in it

Result

cubes

thank you for your help. I added the delay because I linked it to the event tick.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.