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"

Fire a custom event in a blueprint, from UMG

HI all

Looking for some direction on how i go about firing a custom event in a blueprint, from a UMG - (Button).

Product Version: Not Selected
Tags:
more ▼

asked Sep 19 '14 at 11:46 AM in Blueprint Scripting

avatar image

soulmapp
106 15 16 23

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

1 answer: sort voted first

In the details panel for the Button, you can set an on-clicked event. I had an event dispatcher in my function like this: alt text

I can then bind that event in an external blueprint if needed. By casting from the created widget

more ▼

answered Sep 19 '14 at 12:17 PM

avatar image

Mosel3y
1.8k 49 22 67

avatar image soulmapp Sep 19 '14 at 01:15 PM

Already try that. and the cast fails...

alt text

alt text

untitled-1.jpg (330.6 kB)
untitled-2.jpg (355.0 kB)
avatar image Mosel3y Sep 19 '14 at 01:22 PM

Are you creating the widget in this same blueprint? This works for me alt text

avatar image soulmapp Sep 19 '14 at 01:28 PM

nope.. .. i start off in the BP calling the umg widget mainmenu and then add to viewport.. etc.. Then when you click play button insdie the mainmenu umg widget.. i then removed itself and then shows readyscreen umg widget, where i have a final go button which i want then for my custom event inside my BP to trigger..

avatar image soulmapp Sep 19 '14 at 01:30 PM

ah i just see what your doing.. i wil try this now..

avatar image soulmapp Sep 19 '14 at 01:37 PM

OK.. so i have it not failing now.. but the event binding dont seems to be triggering

avatar image Mosel3y Sep 19 '14 at 01:42 PM

Can you put a Print String before the CastTo2DSidescrollergame to see whether the bind is working?

avatar image soulmapp Sep 19 '14 at 01:55 PM

Not fully sure what you want me to connect the print string too.

alt text

untitled-1.jpg (107.0 kB)
avatar image Mosel3y Sep 19 '14 at 02:01 PM

Yep that's it, I presume the Print string didn't do anything then?

When you created the ReadyToStart custom event did you click and drag from the red event square on the "BindEvent to ReadyToStart_Clicked" node and then click "Add custom event for dispatcher"?

avatar image soulmapp Sep 19 '14 at 02:06 PM

nope when i pulled from the cast. i choose one of these. alt text

untitled-1.jpg (57.8 kB)
avatar image soulmapp Sep 19 '14 at 02:03 PM

The print screen.. is printing.. Yoo

avatar image Mosel3y Sep 19 '14 at 02:07 PM

Oh, well in that case the event is triggering. So there must just be a problem with whatever it is actually happening after that

avatar image soulmapp Sep 19 '14 at 02:15 PM

Yep. the print screen even fires after the cast just before the event binding. but the event bind is not firing.

alt text

untitled-2.jpg (138.7 kB)
avatar image soulmapp Sep 19 '14 at 02:18 PM

but i think maybe ive not explained correctly.

All i want is a for custom event to be fired. in my Blueprint when i click play button.. in a umg widget, but the widget has nothing to do with the blueprint i want to fire the event in.

avatar image jaragoondoo Sep 19 '14 at 02:26 PM

Then search for an instance of the "Blueprint" you are after (Search all actors of class), cast it to your "Blueprint" and get it call the event/function that you want to fire.

avatar image soulmapp Sep 19 '14 at 03:03 PM

Yep already tried that. everything i do. fails .. surly there's got to be a way to trigger a event in a blueprint from umg. UMG for me at the moment is a disappointment. nothing really works, no info about it.. wish i started doing the menu the old way in the hud. wouldn't have all these silly issues.

avatar image jaragoondoo Sep 19 '14 at 03:08 PM

Works fine for me, you must be doing something wrong. Have you binded a function to the on-click event, and are you doing what I described in my last comment inside of the bound function? Images below: alt text alt text

avatar image Mosel3y Sep 19 '14 at 03:15 PM

But, you triggered that Print String from UMG, didn't you? I don't think there is a problem with the event, I think it's maybe whatever you are trying to do after that point.

avatar image soulmapp Sep 19 '14 at 03:16 PM

OMG.. so embarrassing, i had duplicated BP files so not to mess up my original, while testing and of course i was still casting to my original... opps.. red face.

Thanks again. seems to working perfect now.

(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