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 you cast to widget

I looked up forums a lot but couldn't find the precise solution I was looking for. Which node do you have to attach to the "object" port in the "cast to" in character bp? I tried the "widget object" and "widget reference variable" but neither worked. Thanks in advance. alt text

Product Version: UE 4.13
Tags:
more ▼

asked Jan 05 '17 at 08:56 AM in Blueprint Scripting

avatar image

PikonParadox
10 2 5 6

avatar image Parth_Bhagat01 Mar 31 '19 at 07:25 PM

Thnxxxxxxxx

avatar image Nebula Games Inc Apr 12 '19 at 07:19 PM

Check out video #25, goes over how to create a bunch of references including widgets.

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

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

1 answer: sort voted first

You can also use the reference directly without having to Get All Widget of Class. Store the reference in a variable when it is returned from the Create Widget node.

more ▼

answered Jan 05 '17 at 10:52 AM

avatar image

Fjellgnu
582 18 24 41

avatar image PikonParadox Jan 05 '17 at 01:21 PM

Hi, thanks for your reply. I'm not very experienced with blueprints yet. Could you please help me understand what you meant by "returning" ? and where is this "create widget" supposed to be?

avatar image Fjellgnu Jan 05 '17 at 07:05 PM

Okay, so ... what happened to the other answer that was here?

I am sorry if I try to explain something you already know, but here goes: alt text

widgetstuff.png (237.3 kB)
avatar image PikonParadox Jan 06 '17 at 02:23 AM

Thank you for your patience and responses. I've no idea why the other answer disappeared. Anyway, I tried what you explained but I'm having trouble with "reference to widget bp." The widget bp doesn't provide "begin play," so i had to set it like this.

PS: I'm using 4.13.2 alt text

widg_char.jpg (309.1 kB)
avatar image PikonParadox Jan 06 '17 at 06:37 AM

Hey, I found an alternative that works perfectly. But thank you so much for answering patiently. I appreciate it. (ignore the booleans, they're meant for other BP references)alt text

alternative2.jpg (358.8 kB)
avatar image Fjellgnu Jan 06 '17 at 11:45 AM

Good work!!

A few things I was going to tell you, but didn't get around to before you solved it:

In a widget you can use Event Construct instead of Event Begin Play. Construct is triggered every time the widget is added to the viewport.

Also the IsValid node is something I used in my example to verify that the widget exists in the gameworld. With a widget there is only a create node and not a destroy node which means that once the widget is created it will remain in memory. This is why it never closed the gate in one of your earlier attempts.

If you have a widget you want to display several times you could create the widget once, store the reference in a variable and then use that every additional time you display the widget. This way you don't add the same widget to memory several times.

And of course: Good luck with your game!!

avatar image PikonParadox Jan 07 '17 at 06:06 AM

Thank you very much! Lot makes sense now. Earlier I misunderstood the purpose of "isValid."

avatar image BigPipiChicken Apr 12 '19 at 06:49 PM

Thank you brudda

(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