Using Array to Create Same Object

Inside my blueprint I have a “WhileLoop” that has an “ADD” array attached to the Loop Body. This ADD array has an actor that is generated inside an Actor Array. Everything works fine, but the actor is duplicated with the same name. For example, if I loop an actor “Furniture” three times, I get “Furniture”, “Furniture”, “Furniture”. Instead of “Furniture0”, “Furniture1”, “Furniture2”.

How can I set my array to make each object in the array unique? I have tried “ADDUNIQUE” instead, but it creates an infinity loop and crashes back to editor.

Any suggestions?

You could get the array index and change the actor/object name by adding the array index to its name? Just an idea. :slight_smile:

Sounds like an interesting approach, but I’m not sure how that would structure. Would I use a “BuildString (name)” and apply this to my object name somehow?

By the look of it, I checked in the blueprints and you can’t exactly change the name.

I could help by what you need the numeration for, you could probably just use the array index for the objects, but it comes down to why you really need the number at the end.

The Blueprint is a widget blueprint and the object is an image. I’m trying to create a dynamic list of images and it appears the only way I can get each object to be assigned to its own column is if it is numbered or does not have the same name. If I manually assign each array object to be “furniture0”, “furniture1”, “furniture2”, etc. It works. But if the array generates the objects as “furniture”, “furniture”, “furniture”, it does not work.

Basically I want the list to be dynamically generated of images to display as a menu option.

Can you take some screenshots of the arrays/widget blueprint, etc.

I work quite a bit with UMGs so I could help out with it if I see it visually. :slight_smile:

Yes I can. Also, I was researching arrays in Unreal Engine and ran across a tutorial. Posted a message on youtube and received some great feedback there as well. It sounds like I need to create a new widget blueprint that holds my images only and reference that from my main widget blueprint. Using the image only widget in my array. Going to give that a try.

Here is a link to the youtube video and the discussion is below that (Eldridge Felder):

Here is the screenshot:


Ahh okay I see, so by the look of it it’s just setting the Furniture Array Element, not exactly sure if that would work since you’re not creating the image, so that’s making it so all of them are the same name. If you were to create the widgets (so as you said) and then set them to the column/add to the grid, etc. then that would change up the names (if I remember correctly from my inventory, it should add it so it’s “furniture_widget0, furniture_widget1”.

Hope that works, you pretty much found the solution, good luck!

Yes. Your description is exactly what I’m trying to achieve. Thanks for the support!

CrimsonWingzz or anyone,

I’ve been researching since I have never done this before, but I can not find a way to have a Widget’s Blueprint communicate with another Widget’s component. Do you know how this is done?

Basically I have created a separate widget called “WBP_Items” that only contains a single blank image that I called “Img” and made sure the check box for “Is Variable” was on. Then in my master Widget, I’m trying to call this “Img” by using “Get All Widgets of Class” > Widget Class “WBP_Items” > Found Widgets is connected to a “GET” node. But I am unable to find “Img”, thus I can not pull this “Img” into a local variable to create an array.

How can I access “Img” that is in another widget? Screenshot below:

be80ccc2527b504d99f9ba987d48db80549dad36.jpeg

First make sure that in your widget that has your image, make sure the image is a variable so it can be accessed, then you can do a Get for the image, kind of like this (not really, but you should get the jist, Item Icon would be your image that you take from your Widget, etc. It is an inventory system but it should still be applicable to your furniture widgets):