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"

How do I cast from one UI widget to another UI?

Title is self explanatory... I looked it up already and I got the following:

https://gyazo.com/4327920ef8f1a321e1c341020e3b1438

But it doesn't work

P.S if I put this on an event tick in the event graph, same result... The text still won't display my value from the other UI widget

Product Version: UE 4.21
Tags:
more ▼

asked Mar 09 '19 at 12:43 AM in Blueprint Scripting

avatar image

blindedeye
5 1 1 2

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

2 answers: sort voted first

Not sure if I understand your setup. You do get all but don't specify an index which leads me to believe there is only one woodclicker widget. Get all nodes are very heavy and quite often unnecessary. I think you would have more luck with a variable text and use set text

Are you trying to update a text in your woodclicker widget?

As for referencing, you can use the node "get user widget object" as a valid reference instead.

more ▼

answered Mar 09 '19 at 01:12 AM

avatar image

Crowley Caine
643 8 9 15

avatar image blindedeye Mar 09 '19 at 05:35 AM

No I'm trying to just get the text... from that widget

avatar image Crowley Caine Mar 09 '19 at 08:18 AM

Then make sure the text in the widget is set to variable (top right in the widget designer). Then give it a name you remember. And after you set your reference just get the text name.

Here's some examples:

alt text

Is that what you're looking for?

widg.png (503.6 kB)
avatar image blindedeye Mar 09 '19 at 06:59 PM

That would be better, but how do i get that target: interaction widget...? I get lost when it comes to cross widget variable interaction :P

avatar image Crowley Caine Mar 09 '19 at 07:13 PM

Well it might not be exactly what you need but what this is, is simply a general interaction widget for NPCs, which I add as a widget component to the actor. I then cast to it in order to change the variable text.

alt text

alt text

I think in your case you are looking for more of a player HUD object. Like these tooltip widgets for example:

alt text

goblins.png (1.0 MB)
widget1.png (85.2 kB)
tooltip.png (325.9 kB)
avatar image blindedeye Mar 09 '19 at 07:17 PM

It is! This whole thing is to create a widget when hovered over a button, and then it displays info about what you are hovering, how much it costs, and the quantity you have, all of which variables are specified in the UI widget; "WoodClicker" and Each hover widget is its own special widget. So I don't understand adding actors so I can do this... and all the youtube tutorials and unreal engine documents confuse me... Do you know a way I can do this... basically the object is the only thing that has made me not be able to get this to work for the past week :P

avatar image Crowley Caine Mar 09 '19 at 07:20 PM

Well it depends a lot on how you have built your system, but as for a tooltip I recommend watching this video and see if you get any ideas from it: https://www.youtube.com/watch?v=628hqEib7kM&list=PLmKKTERcjTPKEPl0nk48Tpmj-iWmzqo_Q&index=14

Essentially what it does is detect on mouse over, then casts to a tooltip widget which is reusable, so no need to create a new one, and simply updates the information. Here's a highlevel view of the type of script in the tooltip widget:

alt text

It's just going through the same process for multiple values, not too bad. But the casting happens by the inventory system, through the slot widget in the inventory which detects the mouse over, which then casts to the tooltip widget the item class and the tooltip widget then extracts the info from that class. If that makes sense.

Just watch the video is my suggestion.

tooltip01.png (408.4 kB)
avatar image blindedeye Mar 09 '19 at 07:31 PM

I still don't know how to get an object from that though...

avatar image Crowley Caine Mar 09 '19 at 07:49 PM

Well for the enemy widgets for example it's a simple matter of just dragging it into the blueprint and using get user widget object.

The tooltip widget is created for each inventory slot that contains anything and updates every time I add something to inventory. Then simply set to visible when I mouse over it. Now of course you could create the tooltip widgets as you mouse over them instead... But I don't see much point. Again, watch the vid. He explains it very well.

avatar image blindedeye Mar 09 '19 at 11:30 PM

Wait where do I put my casting? in the actor bp?

avatar image blindedeye Mar 10 '19 at 12:47 AM

This I ended up figuring out; Thanks for your help!

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

Maybe this will help. I show you how to reference one widget from another widget. It is a viewport widget and a 3D widget component on an actor.

https://youtu.be/BdARbvNrvQE

If that doesn't help check out video #25 about creating references. Towards the end I specifically discuss a widget reference but the other means of creating references may also be helpful.

https://www.youtube.com/playlist?list=PLyu-W38DvZhqByAoeva1jewB5s78zQHIy

more ▼

answered Mar 09 '19 at 01:54 AM

avatar image

Nebula Games Inc
4.9k 27 9 14

avatar image blindedeye Mar 09 '19 at 05:35 AM

This is all UI there is no... 3Dness aspects such as actors

avatar image blindedeye Mar 09 '19 at 05:39 AM

If I need an object... I need to understand how to integrate an object...

avatar image Nebula Games Inc Mar 09 '19 at 07:33 AM

What do you mean "integrate an object"?? A widget must be created by an actor or a global blueprint type like the level or game instance etc. So wherever you create widget A save the output as an object reference variable. Same thing with widget B. Then you somehow will need to reference the actor that created one of the widgets from within the other widget, or get a reference to the global blueprint (think game instance/ level bp etc) from the second widget to grab the variable of the other widget. Either way you're going to need an actor at some point. It would be an extremely odd setup to not use an actor anywhere.

avatar image blindedeye Mar 09 '19 at 07:01 PM

Sorry, I'm lost :P

(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