Add multiple static mesh actor

HI
Is it possible to add multiple static mesh actors into the input to generate an asteroid field with multiple random actors? Why now with this blueprint I can only display one mesh and one actor.
If the answer is yes, where and how more actors are added.
Waiting for a possible reply, I send you my most cordial greetings.


1 Like

Good morning acrobatazongler

Currently i am using SpawnActor node to distribute asteroids into random locations, in random orientations and scales.

That’s not going to work well for a A LOT of asteroids. @acrobatazongler You run a distribution function like this in a loop. Here’s some details:

The entire video is pretty informative. Especially the (h)ISM part.

Why now with this blueprint I can only display one mesh and one actor.

That’s how (hierarchical) ISMs work. Each component can have one mesh but a lot of instances of said mesh. They are very fast to render, though. You could have multiple ISM components, each with a different mesh assigned. This is what would provide mesh diversity yet allow you to render hundreds of thousands and cull them automagically as needed.

1 Like

This is pretty good @Everynone | in my case i needed to be able to move each asteroid as individual units with physics enabled, for harvesting so i only get around 10,000 asteroids in the field before i feel the frame loses.

This would be good for setting up a scene only , where they will not be interacted with or where they need no physics right?

If you interact with one, you replace an Instance with a simulating actor. Just like in a forest with 1 million trees. Physics simulating 10000 actors sounds pretty much impossible… Not where you need the CPU cycles to run the rest of the game!

What kind of quantum machine have you assembled? :innocent:

10,000 with simulation enabled, if they all move at once then it gets pretty heavy.
I have a cheap old alienware shadowcat r8, struggles to just read the news and stay cool LOL.

Thank you, thank you for your quick response. This Tech Art Aid video I know very well. The problem is that he only multiplies a single rock instead I would like to use different rock shapes.

Physics bodies that are not moving are sleeping, a.k.a. not simulating. That’d explain the heavy.

As mentioned above, use many components. You want 10 different asteroids, use 10 comps, each with a different one. Something along the lines of this pseudoscript:

Now you have a thousand of each type, 3k total. You can combine the generation with transforms and, most importantly, Per Instance Custom Data to really work with the data that is already on the GPU.

This is the reason i use SpawnActor Node and run from an array of different meshes. I just reuse the few meshes i have with different random scales, rotations and vectors to make it seem like they are all unique. This keeps my draw calls down since i am only using like 8 different materials.

@acrobatazongler here is a quick set up.
random in an bounding box area.
random scales
random rotator
spawn actor from array of classes
the array of classes in Details.
i run this on tick with a counter, once i hit 10,000 or less it stops spawning.

In this video: UE 4 Minutes TUTORIAL Static Mesh Instance spawn along the grid - YouTube , user @tranceraisch5786 replies to
@subhamsharma8290 as add multiple static mesh actors.
But since I’m not practical in these things I don’t know how to do it.

I’ve just shown you above. For example:

3 different meshes.


Coincidently, this is the place where sobol comes in handy yet remains utterly undocumented. shakes fist @Epic

1 Like

I don’t know how to thank you for your help and advice. Many, many thanks from the bottom of my heart.