Is it really really impossible to add *static* meshes procedurally ?


In the past I have beein struggling to create some logic that allows the automatic placement of actors (which create static mesh components) in levels.

  • I tried inheritance and working with the construction script
    Doesnt work, because you cant spawn actors during the construction script.
    Also child actor functions are not executed when triggered from construction script.

  • I tried blueprints components
    Short story: BP components cant add static meshes.

  • I tried to build the logic within some macros
    Same story: Within macros you cant add static meshes.

I tried child actor components
You cant access child actor component parameter, so useless.

So my last resort was now to use Blutilities, avoiding actor construction scripts altogether.
But here is what happens:

I have a Blueprint (based on actor), which has a function that adds some static meshes:


Another BP implements an event handler that calls a placement function:


The placement function now spawns ActorBP instances with different parameter and triggers their build function:


And when I try this in the level, it seems to work:


The meshes are not static. The add mesh component node is set to movable.

If I set them to static, so I can bake lighting on them, the result becomes this:

They are not created :frowning:

If I connect the Build function to the construction script and them move the actors slightly, the meshes spawn as static, but its not possible to do this manually for all actors…

Now I ran out of all options that I could think of. :frowning:

Is it realy that impossible to have actors procedurally placed in the level which add static meshes :confused:

I would like to create a vast urban environment. For that It would be nice to be able to have a Building actor that creates buildings, based on parameters and is placed by another actor and so forth.
It would be impossible to place 40000-60000 required meshes manually… :frowning:


Have you tried

Zoltan talks about an instanced mesh “instantiator” near the bottom of page 1 which could be of some use to you. May not be exactly what you need but it could serve for your purposes.

Yes, I read that post.
So it seems to work somehow, but its never really shown how the actors are spawned. (Or I missed that).

Ill write a little PM tomorrow to see if I can get a bit of specific help :slight_smile:

I haven’t really tried implementing it yet myself so i can’t comment unfortunately.

Let us know what you find! This is the sort of thing that will be very useful down the line.


Especially in my case.
Im planning a vast urban environment that makes Tokyo look like a ghost town.
Just overwhelmingly dense architecture. The kind of mega metropolis you only see in scifi anime :slight_smile:

Reviewing the picture of his blueprint for the instantiator (attached in post #33), he seems to already have a populated array of references called “meshes” and “instances”, and uses the “addStaticMeshInstance” node to generate the output.

Theres some logic there that seems to check if the mesh isnt in the array, although i think that bit is specific to his own implementation of it.

I do something simmilar.

I check if the reference in my array is valid. If so, the actor already exists. If not, It gets spawned according to the data in the array element.:

But that only works if the class is set in the spawn node and not by the variable coming from the loop element.
This is essentially the same problem as here:

In my blueprint that you are referring to that’s just doing the conversion to instanced static meshes so not quite what he is looking for, although it might be down the track. But I have superseded that blueprint now because of a fatal flaw with it. That information doesn’t get stored in the blueprint so when the construction script is ran it gets destroyed.

So to get around that I store the information of the meshes (or instanced static meshes, works the same for both) in an editable variable so that it becomes available for each actor that’s in the scene so that if its manipulated it can get regenerate itself through the construction script.

Using a custom event from a construction script is definitely possible and thats how I generate the static meshes from the construction script. I don’t think it’s really advised by Epic since you don’t really want that happening at runtime, but for editor development I find it quite helpful.

I can’t really tell you why it’s different with movable vs static in your case but try taking it out of the function and just use a custom event in the event graph and see if that changes anything for you.

You might check out my first map generator thread for advice on how to spawn meshes into the world.

Sorry for that probably stupid question… Iam still quite new to the entire blueprint-system.
In my current project I have to populate a lot of streets with buildings and I set up a constructionblueprint that does that relatively nicely (it’s using the AddStaticMeshComponent-node). But I observed that apparently static lighting does not work on that meshes that were placed by the blueprint… Sooooo, I guess that is a normal drawback of this system?
Or can I make them work with static lighting in a simple way? (I guess that is what this thread was about but I didn’t really figured it out, to what regard the meshes shall be “static”. In my case it’s lighting).

Thanks and best regards!

This is why I create them through a blutility and save the location and mesh etc into an array so you generate them before runtime so that you can bake the lighting out.

Ah, ok. I have never heard of blutility but found it in the documentary. I’ll have a closer look an it, thanks a lot!


Check the details of you AddStaticMesh node. By default its set to movable. Once you change that to Static it should build lighting for them.
Also make sure the scene root is set to static as well…

Oh, that’s an interesting note, I’ll check for that feature! Thanks :slight_smile:

Yay, setting everything to static did the job! Thanks a lot again :wink: