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"

4.16: UMG Bindings not working?

Hello, I have a problem with UMG. The Event from first picture receives data from a DT, I checked it at every single Pin, the Data is definitely incoming and the variables get definitely setted (sry for my bad english).

On the second and third screen you will notice that I bound the incoming data to my elements.

On the last screen, you see the result. Nothing is shown. Is it a bug, or do you see my fault?

Working in 4.16.3.

Thanks a lot. Dom

alt text

alt text

alt text

alt text

Product Version: UE 4.16
Tags:
1-incomingdata.png (365.6 kB)
2-image-binding.png (275.8 kB)
3-text-binding.png (269.1 kB)
4-no-data.png (1.5 MB)
more ▼

asked Oct 31 '17 at 07:00 AM in Blueprint Scripting

avatar image

piontek
11 3 4 8

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

2 answers: sort voted first

I got it. It works now.alt text

I removed the Create Widget Nodes in GameState and Item BP (Because My Widget is created and added to Viewport by Player Controller), And I replaced the removed nodes with the "Get all Widgets of Class" Nodes, looped and variabled them.

So my conclusion for all people with the same issue: NEVER Create more than one Widget. (I think the safer way is, to add another widget only, when the current one is removed).

Thank you so much for your help Everynone.

alt text

it-works.png (871.4 kB)
setupwidget.png (85.8 kB)
more ▼

answered Oct 31 '17 at 10:43 PM

avatar image

piontek
11 3 4 8

avatar image Everynone Nov 01 '17 at 07:55 AM

No, no, you definitely do NOT NEED GetAllWidgetOfClass - I just suggested you used it for debug purposes only - to see how many widgets are created at run time.

If you organise your code right, you will never need that node. Create your widget once, reference it in a location all blueprints can access and use that reference from anywhere in your project to update the widget.

Imagine a situation where you still accidentally create more than one widget, and overwrite its reference in a loop like you do now. You still end up with an orphaned one that will need to be Garbage Collected. While everything may work fine, it's just a bit sloppy and potentially dangerous. In a bigger project, something like that will cause a headache.

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

Could you confirm that the PrintString in the first screenshot prints correct data?

more ▼

answered Oct 31 '17 at 10:19 AM

avatar image

Everynone
15.2k 77 25 62

avatar image piontek Oct 31 '17 at 10:32 AM

Yes, certainly. I checked it not only one time and in one way.

The Data Table Event fires from a simple Actor directly to the Widget.

Input controls and communication go on Player Controller & GameState.

But the Event "Get Item" in Widget is definitely executing and Its printing the "filled" variables.

alt text

5-print.png (948.3 kB)
6-dt.png (64.2 kB)
avatar image Everynone Oct 31 '17 at 10:52 AM

As a test, could you Remove the binding from the Text Block, expose it as variable and set its text directly like so:

alt text

Btw, your blueprint looks good, I'm just trying to establish what else could be happening. Perhaps something else is overriding those variables on Tick. Let me know if setting the text block's text directly produces anything in the widget during run-time.

capture.png (36.8 kB)
avatar image piontek Oct 31 '17 at 01:30 PM

Unfortunately that also didn't work. It is the same issue than before.

alt text

alt text

alt text

settext.png (384.2 kB)
indesigner.png (264.7 kB)
ineditor.png (1.1 MB)
avatar image Everynone Oct 31 '17 at 01:38 PM

If the screenshot you posted is with the binding removed, the issue lays elsewhere; could you show the blueprint responsible for creating and adding the widget to the viewport or canvas, the widget reference and how you use it to fire GetItem custom event?

At the moment I'm thinking that you might be creating more than one widget and send the data to a widget that we cannot see.


In addition, if you want to do some digging yourself: Hook up a GetAllWidgetsOfClass node to a Tick in any non-widget blueprint, like a PlayerController for example, and see how long the returned array is.

avatar image piontek Oct 31 '17 at 10:03 PM

btw Thx for your support. The first pic shows where the event is firing into the widget, and the second picture shows where the "interact" input is coming from. (Its like a Key-Hold-Down-for-x-Time-Script).

alt text

alt text

avatar image piontek Oct 31 '17 at 10:12 PM

Yes you're right, I'm "creating" the widget in my Item BP but also in Player Controller and Game State to get a reference to it (because some events I need from the widget to change something in the GameState and some Control Input Issues I need to control in the Playercontroller.!

In Player Controller I'm adding The Widget to the Viewport. The Event is coming from the Item-BP.

alt text

I'm little bit confused, is it something what one better should avoid? Or is there a more elegant way to get a reference to one Widget in different classes?

alt text

avatar image piontek Oct 31 '17 at 10:30 PM

Oh wait, Is "Get All Widgets of Class" a new Node? I never noticed, that I can directly cast to them. That was my problem. (My Print shows an Index of 2 Widgets in Length -> Top Level is false).

I will fix that quickly in my Gamestate and Item BP and give you info.

avatar image Everynone Oct 31 '17 at 10:47 PM

Yes you're right, I'm "creating" the widget in my Item BP but also in Player Controller and Game State to get a reference to it (because some events I need from the widget to change something in the GameState and some Control Input Issues I need to control in the Playercontroller.

If you create a widget 3 times, you may end up with 3 separate instances of the widget and send the data to the referenced one that is not in the viewport, for example. Ideally, you should create a widget once, store its reference in an easily accessible location (like game mode or player controller) and show/hide only.

If I were you, I'd try the bit I mentioned first:

In addition, if you want to do some digging yourself: Hook up a GetAllWidgetsOfClass node to a Tick in any non-widget blueprint, like a PlayerController for example, and see how long the returned array is.

avatar image piontek Oct 31 '17 at 10:55 PM

Yes I placed a GetAllWidgetsOfClass and the returned array was 3 Widgets which were created. But I didnt mentioned the "GetAllWidgets..." Node before.

avatar image Everynone Nov 01 '17 at 08:00 AM

I quoted myself from a post above in case you missed it.

(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