i was following this tutorial: https://www.youtube.com/watch?v=kmnC6IUPGjI
where he shows how to use a FOR loop to make an extendable wall widget. and i got ambitious and extended that into being able to extend the static mesh in all 3 axes.
but what i would like to do is have an empty actor i can place in the level, that has a list of static meshes i can pick, so i would just use one blueprint to build walls and floors and roofs and rooms, etc.
according to this reddit post, it SHOULD be possible? (i think.)
https://www.reddit.com/r/unrealengine/comments/zbbx8k/i_would_like_to_know_how_to_dynamically_add/
i can add a static model variable to my empty actor blueprint… but don’t i need an enum to make a list of meshes i can pick from?
i’m REALLY new, can anyone interpret and expand into actionable noobie steps what the answer is saying? specifically this part:
You can also setup one actor with an Static mesh Object reference variable which has the checkbox for Instance Editable and Expose on Spawn checked and also add an static mesh component to this actor. Now in your Event begin play you get the static mesh component and set the static mesh of this component to be the static mesh from your Variable. Since you marked the variable to be exposed on spawn you can call the node Spawn actor from class, select your actor and the variable for the static mesh will also appear as a pin.
thanks!!!
is doing this a bad idea?
after i use the widget to spawn the room sides and floor planes, can i somehow turn off the script and make the pieces ‘real’? like after i place all the walls, i may want to edit one and change it into a doorway.
would it be better to just hand build every piece?
Hey i just set up the actor in the way described so you can visually see what’s going on.
I’m not sure this is the solution you are looking for though.
Are you trying to build at runtime or place in the level editor?
If it is the latter begin play would not work for you, but you could use the actors constructor to set the mesh if you wanted.
To get a list of static meshes you could use an array, set it to be instance editable, and populate it in editor.
heyas, wildlight!
thanks a bunch! i still have a lot of newbie questions!
firstly, yes, this is for the editor, so i can make walls of varying lengths with one of those widget things.
1: how do i tell this Set Static Mesh box what mesh i want to use?
i tried making the object variable an array, but i couldn’t plug it into the new mesh mode like that, so i stuck it through a RANDOM function.
ps: can i use an ‘instanced’ static mesh here, instead of a regular static mesh?
1a: i think i need a static mesh variable that gets set from the static mesh array. but i don’t know how to do that.
2: in the tutorial i was following, the wall is constructed using an Add Static Mesh Component node, and the static mesh that it is adding is right in the titlebar of that node, instead of in something that plugs in.
how would i use a variable with that node?
Lastly, once i use this thing to build a wall 20 units long… how can i go back to that wall in the editor, pick one of the pieces, and change it to something else, like a window? is that possible to do? to like “freeze” the end result wall so i can edit it normally?