Event Dispatchers not receiving "Calls"

I’m using Event Dispatchers that Bind on Begin Play, and they usually work, but sometimes they do not. Here is the binding and events side of the code:

Tried debugging. It goes through all the bindings in the top row in the Begin Play event. The issue is sometimes none of the “Calls” are received by the events (2 of the events are displayed in the screenshot). It usually all works, but sometimes it does not, and I can’t tell why.

Two questions:

  1. Any idea what’s causing this or what I could do to investigate possible causes?
  2. How do I fix it?

Since I can’t see your event dispatcher calls, I can’t speak to their logic; so, I can only point out maybe adding a delay before your call.

Essentially, if debug Y is pressed before debug T’s delay (representative of your code) completes, event Test will not fire. So, you must ensure that the Call Test Event (in my case), triggers after the Bind Event to Test Event has been set.

1 Like

Hmmm… Thank you for the answer. I tried to look into it, but I don’t think that’s the issue. The Binding is almost definitely happening before the Calling, as the Binding occurs on Event BeginPlay. The Calling happens in various stages throughout what are basically turned-based battles. Here is an example of one:

The Space Bar is triggering this EndTurn event.

But yeah, sometimes I press the Play button to start the project and all the Calls in the project work every time, and sometimes I press the Play button and none work at all, ever.

Do you perhaps have any soft references, which may not be loading? I’ve found that when they don’t load, in an attempt to troubleshoot I open files and/or edit code, which gives me the false that they’ve loaded. Then I reset the engine, and they don’t work again. Verify that everything works immediately after the engine is reloaded, that way you know it doesn’t just work after you tinker with things.

Aside from that, debug with printscreens. Confirm that your Get Actor of Class is always working. That you Phase variable is actually set to Setup when it needs to be. Just brainstorming.

1 Like

Yes! What you are describing does seem to be my issue. Thank you. How would one fix such an issue? Sorry, I’m very much a noob with this stuff.

Does the “Get Actor Of Class” here not create an appropriate reference?

EDIT: To confirm, on boot up, Event Dispatch calls stop working. It gets fixed when I disconnect and reconnect the pins between “Get” and “Bind event…” But will stop working again on a reboot.

To my knowledge, Get Actor of Class will only work if that specific actor is preexisting in your level. So, anything other than manually dragging it in or perhaps spawning it via a construction script will not do.

Another possibility is that you forced those nodes together unnaturally. Try drawing out the BP Duel Character pin from your validated Get and recreating the binding. There’s a slight chance that you created the bindings from some other node, deleted it, and just reused the code that followed. Sometimes UE will accommodate node mismatches for a time, then just suddenly stop.

1 Like

One other possibility you might try is to use the standard Custom Event instead of the Create Event node. I’m just suspicious as I’ve never used it before. Either connect them directly (if in the same blueprint) or call to them via a blueprint interface. This would eliminate that point of failure.

I still have not fixed this issue. :frowning: I tried a lot of different things, but no luck so far.

Unfortunately, I’ve reached the limit of blind guessing. There’s too much specific information about your project, which I don’t know. Naturally, there are more knowledgeable user here, but I can’t image they wouldn’t also benefit from knowing more.

What BP is this event beginplay running from? An AI enemy? Your main character?
If AI, is it preexisting or spawned later?
Is BP Duel Character preexisting or spawned later?
Do you begin with a widget (system) menu or just go straight into play?
Have you confirmed that Get Actor of Class consistently sets BP Duel Character (via print strings)? And/or, have you isolated the exact node that doesn’t consistently fire (again, via print strings)?

this sounds like a bug, maybe try recreating that section of logic. Also try dragging the delegate pin straight to the event, maybe the events were renamed at some point and the CreateEvent is confused.