Static mesh component array variable doesn't populate

Hello,
I am trying to load a list of static meshes into a variable.

I am confused, since I can print what I want just after creating my variable, however, when I get my variable separately and try to print its content, I only get the last element of the array.

Any idea on what I am doing wrong here?

Thanks,

Mat

you shouldnt be using a set in this case. instead you want to be using a add or add unique node. what you currently have tells it to get the components then make an array of only those components so its overwriting the array everytime.

what are you doing where you need to get the meshes of all actors of that class? seems like and odd situation or that there may be a better way to go about it.

Hi Thompson,

Thanks for pointing me in the right direction.
I see what I am doing wrong with the array. What I am trying to do is a gallery/inventary type of scenario:

  • I currently have 4 objects displayed in front of me, (embeded inside their own blueprint: BP_thumbnail1, BP_thumbnail2 etc…)
  • On grab BP_small*, a version of the grabbed object is displayed on a larger “holographic” blueprint, floating in front of the player.
    This works well, and is triggered through a custom event where the hologram gets fed the static mesh of the thumbnail being grabbed.

However, we need to extend the gallery to many more objects.

  • One button will remove the current 4 and load the next 4 objects.

The thumbnails blueprint are fairly complex, and have a few connections and triggers I want to keep as they are. I just want to load up a different mesh.

My plan is to have all the gallery loaded in the level, but invisible, and on the push of the button: look for all the blueprints making up the gallery, filter out by tags, and display the static mesh of the next relevant 4 inside of BP_thumbnail_1,2,3 and 4.
Since they are already setup, on grab, the thumbnails will send the correct signal to the hologram, and the hologram will display the newly loaded static mesh.

This seems more flexible than replacing the thumbnail blueprint straight up, but I am more than happy to hear of a better way to do it.

  • I mean, on grab BP_thumbnail*, not BP_small…