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

**URL:** <https://forums.unrealengine.com/t/best-way-to-store-actor-reference-s-in-variable-s-in-level-blueprint/393939>\
**Category:** Editor Scripting\
**Tags:** reference, initialize, unreal-engine, Blueprint, question\
**Created:** [May 18, 2017, 12:29pm UTC](https://forums.unrealengine.com/t/best-way-to-store-actor-reference-s-in-variable-s-in-level-blueprint/393939 "2017-05-18T12:29:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![n2k](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@n2k](https://forums.unrealengine.com/u/n2k)\
**Post date:** [May 18, 2017, 12:29pm UTC](https://forums.unrealengine.com/t/best-way-to-store-actor-reference-s-in-variable-s-in-level-blueprint/393939/1 "2017-05-18T12:29:49Z")

</div>

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](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](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?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_4133bf2b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4133bf2b](https://forums.unrealengine.com/u/anonymous_user_4133bf2b)\
**Post date:** [May 19, 2017, 2:37pm UTC](https://forums.unrealengine.com/t/best-way-to-store-actor-reference-s-in-variable-s-in-level-blueprint/393939/2 "2017-05-19T14:37:16Z")

</div>

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](https://docs.unrealengine.com/latest/INT/BlueprintAPI/Utilities/GetAllActorswithTag/index.html). 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.

---

<div class="post-metadata">

**Author:** ![n2k](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@n2k](https://forums.unrealengine.com/u/n2k)\
**Post date:** [May 22, 2017, 6:43am UTC](https://forums.unrealengine.com/t/best-way-to-store-actor-reference-s-in-variable-s-in-level-blueprint/393939/3 "2017-05-22T06:43:18Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![n2k](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@n2k](https://forums.unrealengine.com/u/n2k)\
**Post date:** [May 30, 2017, 7:47am UTC](https://forums.unrealengine.com/t/best-way-to-store-actor-reference-s-in-variable-s-in-level-blueprint/393939/4 "2017-05-30T07:47:50Z")

</div>

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](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.
