Best way to store actor reference(s) in variable(s) in level blueprint?

How can I store a Static Mesh Actor reference in a (public) variable in my Level Blueprint?

Without initializing them myself this way:

http://i.imgur.com/rTKeVqN.png

Because I can’t set the default value of a Static Mesh Actor variable in the Blueprint Editor:

http://i.imgur.com/S04oQoa.png

Or if I seem to go the wrong way about this, what would be a better way get these 8 Static Mesh Actor (that are already placed in a level in the editor) as references in variables? I want to have specific references to each of the 8 objects, not as a group, so I can hide/show them individually with my own function?

This might not be the most code efficient way, but you could assign actor tags to your static mesh actors in the level and then in your blueprints iterate through GetAllActorsWithTag. No storing of variables needed, only that you’ll need to call that function each time you want to do some logic with those actors.

Thanks for your response, but I want to have specific references to each of the 8 objects, not as a group. I should’ve probably included that in the original post :slight_smile:

I think I was going about it the wrong way, in the Level Blueprint you don’t need to store Static Mesh Actors in variables that already placed in the level. Every time you require a reference you simply select the Actor in the viewport, right-click in the Level Blueprint and click on Create a Reference to “YourActorName”.
For example:

http://i.imgur.com/pVxfe07.png

In other cases you would need to assign references to variables, for example if you are spawning Actors with blueprints.

1 Like