So I finally got a dispatcher to work, but it only works when its triggered from a button click?
Random custom events wont trigger the call…
Any ideas?
Thanks!
Ya I just tested it again, a custom event actually will fire a call for an event dispatcher…but only if a button click is used to call the event from within the same BP.
Im trying to call an event in another blueprint, and then off that execution call an event dispatcher… and es no bueno.
Test Event 1 is being called from another BP. Even though I have confirmed through the print string seen “Hello2”, that Test Event 1 is firing just like the second image, the dispatcher refuses to make a call.
Everything seems fine there, could we see where Test Event 1 is being called in the other blueprint, and what is on the other end of the event dispatcher please?
I realize Im creating widget 1 twice but that seems to be the only way I can get the Bind Event Node to work
Also, again, I realize creating a widget in a widget is weird, but, again, it seems to be the only way I can get the dispatcher to work.
Maybe Im just dense when it comes to references but the dispatchers dont like my reference unless they are first created from within the very blueprint I need them in.
You are sending the event to the widget that isn’t connected to the event dispatcher binding event.
In widget_2 you create a widget_1 and set it to Widget 1 Ref. You then call the event on that invisible widget_1.
In actor you create another widget_1, this time visible, and set it to New Var 3. You then bind it to the event dispatcher. Because you’re not calling the event on the widget that is hooked up to the dispatcher it won’t work. Basically nothing calls the custom event on the widget that is hooked up.
When you call the event in widget_1 with self it works fine because the event is actually getting called on the visible widget_1 that is hooked up to correctly.
What I would suggest is to move the widget creation stuff into the player controller, because you can always get a reference to it by doing Get Player Controller. That way you don’t need multiple widgets of the same type (you don’t need that now either but anyway). Set up a variable there and get that reference in the actor or whatever and you should be able to call it assuming you hooked up the binding in the player controller too.
So I moved the creation stuff to the player controller like you said, as seen below, the player controller in the top down example project was named TopDownController, so that is where I put it.
You can call the event dispatcher from anywhere, just get the widget reference from the player controller. I didn’t add it as a variable here but do that (like in your last picture).
But I have no use for a custom event in my player controller, I appreciate and I atleast believe I understand what your telling me to do but 'Im not trying to fire an event in my player controller.
I never switched to a custom player controller Im using the default one provided in the top down example project
Edit: I’m not sure how adding the bind and custom event would have made it work, I tried it anyway and my player controller ref still inst working
I mean it doesn’t have to be in your player controller, the point of the player controller is that you create the widget there so you can easily get a reference to your widget with the event dispatcher. You need to cast from Get Player Controller to the real player controller BP (pure cast works too).
Some more things you can do:
Call the event dispatcher from some other BP
Call a custom event in your widget from some other BP
Bind a new event to the event dispatcher in some other BP (turn off context sensitive to show it in the list), easy when you can get a reference to the event dispatcher in the widget.
Im literally in tears! You flippin did it m8! The cast node was all I needed! Taha! Im gonna go learn about casting! Cheers!
I only kinda have an idea of what u did but your instructions worked! I create the widgets in my player controller and then I use the cast nodes to reference them properly which then allows my blueprints to properly contact one another!
Cyaoeu for president! Also will you be my big brother?