x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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 alt text

Product Version: UE 4.18
Tags:
arrays.jpg (332.2 kB)
more ▼

asked Apr 24 '18 at 01:59 AM in Blueprint Scripting

avatar image

suisso
26 3 8

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Apr 24 '18 at 02:05 AM

avatar image

ThompsonN13
10k 33 9 23

avatar image suisso Apr 24 '18 at 05:41 AM

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.

avatar image suisso Apr 24 '18 at 06:05 AM
  • I mean, on grab BP_thumbnail*, not BP_small...

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question