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"

List actors in UMG

Hello.

I have an array of "props"

alt text

and i want game to create buttons for each one of them like this:

alt text

and after each button press i want this to be called

alt text

Thank you.

Sorry for bad english im not a native speaker.

Product Version: UE 4.18
Tags:
more ▼

asked Dec 16 '17 at 10:11 AM in Blueprint Scripting

avatar image

piter2268
1 1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

You have to create the button in a separate widget : create an Int called Index and make it visible (can be exposed on spawn if you choose to create the button manually). Put as many instances of the button on the main widget. Now get what you need from the button widget (cf picture). You have to Get all the buttons added in the main widget. Using Tick is fine but I would recommend using BP Interface.

alt text

button.png (83.2 kB)
more ▼

answered Dec 16 '17 at 10:49 AM

avatar image

Ego Studio
606 4 4 5

avatar image piter2268 Dec 16 '17 at 11:24 AM

Is there a way to automaticly create as many buttons as array lenght?

avatar image Ego Studio Dec 16 '17 at 11:53 AM

It should look something like this (the button index exposed on spawn) alt text

array.png (46.2 kB)
avatar image Ego Studio Dec 16 '17 at 11:56 AM

I forgot, if all the buttons fire the same function, you will be able to call it inside button widget OnClicked, instead of using tick on the main widget.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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