How could I sort spawn characters with Blueprint?

I am an Unreal beginner but I have to change a blueprint which I got from an expert :weary_cat:

As you could see “BP_Zeiger” spawns characters every 2 seconds. In “BP_Character” I try to sort 10 character with a simple array (0-9) and a loop. I used an interface to get the spawn timing from the “BP_Zeiger into” my”BP_Character”. I am using two different blueprints, because I have taken over the project and I want to change as little as possible.

I would like to spawn 10 different characters one by one, so that I have 10 different characters at the end. Unfortunately at the moment I could only change the first spawn character, not the other ones. What am I doing wrong?

I don’t really see that “BP_Zeiger” is spawning a character every 2 seconds.

I see that it probably could but what should be called to trigger SpawnActor is outside of the screen capture.

I see that there is a timer but it is a mystery of what event is actually called on the timer.

I would think that whatever is called from the timer is also the thing that is calling the spawn.

In this case you should probably just add a gate with a counter at the start of that particular event.

I am at loss however why would you have 3 separate inputs in the timer.

This will create a new looping timer every time it is called. You don’t need that. If you leave only the first line from Begin Play you can be sure that whatever event is attached to the red square will be called every X seconds.

P.S.
This is the only thing needed to spawn X objects one by one 2 seconds apart:

Thank you very much for your fast answer! :folded_hands:

Sorry that I confused you with my BP, which are full of mistakes. I think is a better idea to attached the original script, which I get from the company who programmed a small game engine for my art project.
As you can see in BP_Zeiger is the “Set Timer by Event” on 2 seconds. BP_Zeiger works basically in the same way like your example, I think so. In BP_Character is a Random node which makes me crazy :grimacing: My idea was to delete this random node in BP_Zeiger and to replace it with a function which sort my character one by one, maybe with an array loop.

The random in BP_Character is evaluated only once when the Get Skeletal Mesh Asset is called. In order to get a specific one you should use a simple get Get:

However you must increment that index and the best way I can think of is to set the Index variable instance editable and exposed on spawn. This way it will show up in BP_Zeiger Spawn Actor BP_Character. From then on it is just a matter of storing an int and incrementing it every time you spawn a character.

I’ll still point that this is wrongly linked:

The timer will already re-trigger because of the looping…

1 Like

Sort Spawned Characters Using Blueprint Tips .

“the best way I can think of is to set the Index variable instance editable and exposed on spawn.”

thank you very much – It makes absolutely sense what they write. I wouldn’t waste your time, but do you have an idea or a tip in which way I could set the index variable?

This is how you set a variable exposed on spawn in your BP_Character:

Set that way it will pop here when spawning in BP_Zeiger:

And you can set the actual model in the BP_Character as I’ve shown you above:

1 Like

Wow perfect, it works :slight_smile: thank you very much for your patience. :folded_hands:
I ingnored the “Instigator” connection to the “Self” Node, because I don’t understand it. I told you, I am an absolute beginner. But never the less it work .