How to generate many actors

This is my code:

The logic is as follows:

The map is a landscape with a texture of stars, 1 square kilometer, 100800 pixels by 100800 pixels divided in 160 by 160 sectors of 630 by 630 pixels each

The loop should go on 25600 times in order to fill each sectorwith between 0 and 2 star systems but I set it to 4 times to make the test faster.

For now it just draws a star, no planets yet because this is in a very early stage, this is actually the first time I test it and in order for me to add new types of stars and planets I had to test this.

The problem is instead of drawing many stars it just draws one star and moves it many times.
As you see I tried moving the actor and now moving the component and it doesn’t work

Question: How can I make the loop draw many stars? Or create many actors instead of just one?

  1. Dont change the input for forloop and foreachloops because in your example you ask every loop for a new random int (0,1,2)

  2. because of the loop your move component function will overridden and the sprides stay on the same location

Try.

Sorry to answer you late, I’m a bit busy with studies.
You know? It actually worked! Thank you a lot! I also learned a bit on how to arrange the nodes so that it doesn’t look so crapy. Thank you and good day

Edit: It does this:

I thought I could solve this myself but I can’t.
The first star has a good rotation, but the rest have a different rotation and its coordinates aren’t okay, they change the z coordinate and that should be constant, 110.
I think it has something to do with relative transform.
I programmed this with absolute locations in mind, not relative xd

Could you please help me?

I’m constantly changing the code and it’s doing strange things like that all the time

Edit2: I tweaked the code a little bit, it now does this:

The rotation is wrong except from the first one, but at least the coordinates are a bit better.

I still don’t know how to change its rotation, it does some pretty crazy stuff

For coordinates you just had to move your actor with all that componant to the right place and maybe rotate it.

It looks like all sprites are rotated as the code told them except for the first one.

Are you spawning the first spride separately?

Have you one spride allready spawned inside the blueprint?

How does your code look now?