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"

[UMG] Communicating from a widget blueprint to the level blueprint...

Sorry if this has been answered, I'm trying to get a button in a UMG Widget blueprint to fire a event that gets received in the level blueprint. For example the player presses a button in the Widget blueprint and a wall in-game (inside the level blueprint) gets destroyed. How can I best achieve this? How would that look in a Widget blueprint graph? How would it look inside the Level blueprint event graph? Do I use event dispatchers? Can I cast a variable to the level blueprint from the umg widget? What would be the best solution?

I've looked at this thread https://answers.unrealengine.com/questions/101114/fire-a-custom-event-in-a-blueprint-from-umg.html without progressing any further.

I'm on UE4 4.4.

Product Version: Not Selected
Tags:
more ▼

asked Oct 07 '14 at 12:52 PM in Blueprint Scripting

avatar image

JakobR
98 7 17 16

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

4 answers: sort voted first

I don't know if Unreal 4.5 resolved some problems with the event dispatcher of widgets...but my trick works fine:

  • Go to player character blueprint and create a custom event and a event dispatcher and connect the custom event with a call of the dispatcher

  • Go to your Widget and cast the player character inside a Widget function and call a Custom event that you created earlier.

  • Finally...in your level blueprint : Begin Play cast MYCHARACTER (or your player) from Player character and assign the event dispatcher you created in the first moment.

After that you will communicate to the level Blueprint when you interact with de widget button

more ▼

answered Oct 20 '14 at 10:36 AM

avatar image

LitStudio
371 55 49 64

avatar image ANGOmarcello Jan 25 '17 at 10:26 PM

That was very helpful. Here are blueprint screenshots for the steps:

1) alt text

2) alt text alt text

3) alt text

Please ignore the sequence player stuff as it is unrelated to the question.

1.png (144.6 kB)
2.2.png (133.9 kB)
2.1.png (64.8 kB)
3.png (154.1 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I wouldn't bother involving the Level blueprint.

In the Widget blueprint you can use GetAllActorsOfClass to find your wall objects and then notify them directly by casting and calling a function or event on them.

more ▼

answered Oct 07 '14 at 04:10 PM

avatar image

cgrebeld
497 25 16 33

avatar image JakobR Oct 08 '14 at 04:22 PM

Thanks for your response,

I've tried the method you describe, and it would entail creating separate BP actors which act upon a custom function.

alt text

However it would be more convenient to have it called in the level blueprint to, say, trigger multiple action like say starting/stopping a matinee how would i do that?

It finds the Level blueprint however I must be doing something wrong, I get this error message:

alt text

bp_question2.jpg (245.5 kB)
bp_question.jpg (382.3 kB)
avatar image Bakla Firoz Oct 20 '14 at 07:00 AM

I'm pretty sure that this is a bug. I get the same error message when trying to save after referencing the level blueprint from a widget blueprint.

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

You could use an event dispatcher on your Widget. The level BP would have to get a reference to Widget and then bind the event dispatcher to the logic you want executed.

Then inside your Widget you just have to call the event dispatcher at the right time.

more ▼

answered Oct 08 '14 at 05:15 PM

avatar image

cgrebeld
497 25 16 33

avatar image Bakla Firoz Oct 20 '14 at 07:03 AM

I was under the impression that you can only event dispatch something that already exists in the level as you have to click on it to reference it in the level BP. Is this not the case?

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

I agree that your best bet is to use an event dispatcher, heres a video that really helped me.

link

more ▼

answered Aug 27 '15 at 08:50 AM

avatar image

Skos
86 7 14

(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