Event Dispatcher not working

Hey
I am trying to use a Event Dispatcher (“Object Level Updated”). The odd thing is, when I call the node with begin play the event gets dispatched and everything works. However when I call the Debug Event I get the “Debugging” text printed on the screen, but the Event does not get called?

Does anyone have a idea why the event dispatcher behaves this way? Does anyone have a fix? Or is the best bet to just nuke the class and do it again?

I guess you didnt understand dispatchers. Whats the blueprint of Level Updated function ?

SAdly this lost some pictures, but maybe you can dig enough info from it to undestand dispatchers:

The Setup in the screenshot above is just for debugging. The Event Dispatcher is called by a function wich is called through the Remote Controll Api. The Object Level Updated is bound to the onObbjectLevelUpdate Event in another Actor-B

Pls correct me if I am wrong. But I think I do understand event dispatchers, but I am not good at explaining my problems :sweat_smile:.

In my Project I have an Acotor ADManager wich controlls a large amount of Actor-B in the Level. Thats the reason why I choose Event Dispatchers. In the Actor-B the dispatched event is bound to an event(see screenshot above), that needs to be called from the ADManager.

Fixed the Problem and kind of ashemed of the mistake … It had nothing to do with the Event Dispatcher. But thanks anyway for the fast responses @Nawrot @CtnDev.

I will now try my best to explain the Situation. This is the project structure. I use Insomnia to send Http request at runtime to the Connection Manger (red arrow). The Call then gets send to the ADManager wich dispatches the Event to update the ADActors.
0

While debugging today I tested to call the ADManager directly wich somehow worked. Then I realized that the mistake was not in the engine, but in the Http request. I had forgotten to add UEDPIE_0_ to the object path wich is used to call objects at runtime.

The reason why I didnt noticed it earlier is that when this part is left out and you call this HTTP Request at runtime. The Engine still responses and executes the function on the ADManager in the Editor BUT not on the ADManager in the live Game.
Therefore the Event Dispatcher worked when I called it with the Delay but did not work when I called him trough the Remote Control API at runtime.
I hope this helps to understand the situation,
have a nice day.

I see you at place in unreal dev where you need some system for communicating.

What I did some time ago in similar spot you are now in:

  • create “global” dispatcher in game state or game instance game mode etc. some actor that is persistent trough level and present on servers and clients (depends if you have multiplayer game or not)
  • create event there that calls dispatcher
  • create dispatcher that sends events out. It should have variables like: enum with what group or type of event it is (or who it is sent to), and STRING field that transmits value (you can change type of almost everything into str and other way around)

Then all actors that need to be aware of any event hook to that dispatcher.
I usually make one such dispatcher for all actors in level (then dispatcher is in game mode or game instance). and one for sending stuff to GUI/umg (then dispatcher is in player controller).

This way you have all the code in single place, and standardized way of communicating.

1 Like