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"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

UI Binding Variables for Instances

Hi,

I have 2 actors within the scene that are the same and I want the UI to display their variables individually. For some reason, the UI is display the variables for 1 actor and not the other. Any help will be greatly appreciated :) I just don't know how to bind instances of the same actor. :(alt text

Product Version: UE 4.16
Tags:
capture.jpg (45.2 kB)
capture1.jpg (76.1 kB)
more ▼

asked Sep 21 '18 at 09:38 PM in Blueprint Scripting

avatar image

AkatoshReturns
33 16 19 23

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

2 answers: sort voted first

For some reason, the UI is display the variables for 1 actor and not the other

Your loop fetches the first actor from the array and exits immediately, it never has a chance to complete iteration. Even if it did (if you used the Complete pin instead), it still would not work. You'd be always displaying the last index in the widget.

Using All Actors of Class is by far the worst way of doing this.


Just to clarify, you want each object to have its own widget, right? Do you create the widgets inside the objects? Or?

more ▼

answered Sep 21 '18 at 11:53 PM

avatar image

Everynone
13.7k 74 25 57

avatar image AkatoshReturns Sep 22 '18 at 12:17 AM

But yes, I want the widget to bind the variables individually.

avatar image Everynone Sep 22 '18 at 12:28 AM

The widget is created the moment you pick up the object

The question is not when but where. Do you create the widget inside the objects? Is your create widget node inside the weapon?


I could just tell you to pass the weapon reference to the widget but that's, most likely, not enough hence all my question. :)

Here's the general idea:

  • create a weapon object reference variable in the widget - just like your weapon entity but not an array

  • flag this variable as Instance Editable and Expose On Spawn - this will give you an extra pin when you create the widget

  • when your weapon object creates a widget for itself, plug self in to the widget's additional pin

The above assumes it's the weapon that created the widget.

avatar image AkatoshReturns Sep 22 '18 at 12:35 AM

It works! :D Yes, I was creating the widget inside of the weapon blueprint. For some reason, I relied on get all actors of class to bind my variables. I know this is bad as it can have an effect on the performance of the game. Thank you for your help! :)

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

The widget is created the moment you pick up the object, which then I use remove from parent when I drop the object.

more ▼

answered Sep 21 '18 at 11:56 PM

avatar image

AkatoshReturns
33 16 19 23

(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