Array of Static Mesh Actors

I’m trying to create a puzzle that involves a 2 types of doors: blue doors and red doors. I’m trying to create buttons (1 blue and 1 red) that makes all doors of the same color move the same amount in the same direction. My plan was to make an array that stores all the doors, one for blue doors and one for red doors. When the blue door button was pressed, for example, a function would be called that did a for-all loop to apply a movement timeline on each and every door i placed in that array. However, creating the array is causing difficulties. I can create an array of static mesh actors in the level blueprint, but if i make one in a class blueprint, i can’t get the instances of the doors because they aren’t components of the blueprints. Is there a way for me to make an array of walls in my world that the class blueprint (the button) can access so i can use the for-each loop on it? I guess another way to put it is: is there a way for me to collect static mesh actors outside of my blueprint, either in the class blueprint or in the level blueprint, so that the buttons can access the collections?

Create blueprints using the blue and red meshes. If you create two blueprints for the blue and red doors, they would be actors in teh level so you can use a "get all actors of class node and run your for loop using that.

You can use the level blueprint to add the static mesh actors to the array; with references from the level in the level blueprint you have access to the actors. Then you can use the array to refer to those actors from within the button blueprints.

To do this, create an Editable variable of the type Actors (Array button selected) on the button blueprint. From the level blueprint you can get the array and use the Append node to add actors to the array (preferrably as soon as possible, e.g. in BeginPlay). Then when the player interacts with the button, you can reuse your existing function that applies the movement timeline.

Hope this helps,


the problem i’m currently having is that i can easily make a timeline in a class blueprint, but i can’t reference any objects in the world unless they become static messes in the class blueprint, which would not work well when making multiple levels. However, I can easily make the array in the level blueprint but I can’t seem to get it to work so that i can move them in the level blueprint or send the array the level blueprint made to the class blueprint so that the class blueprint can apply its timeline to the array it received. I looked up how to make a variable of another blueprint, but i can’t seem to reference anything located in the level blueprint from a class blueprint