Widget calling an actor's custom event

Hi guys

I’ve got a custom event (LoadDialogue) that was setup on an Actor BP, which works fine when triggered by the BeginPlay event.

The problem I have is that I have a widget with a button and an OnClicked event that should trigger that event, but it doesn’t. I put a Print Text node directly after the call to the custom event, and that fires correctly each time, but the event itself only ever triggers on the BeginPlay event (I’ve confirmed this by putting another Print Text node right at the start of the custom event, which only displays on the BeginPlay event and not when the button is clicked).

Here’s the Widget BP, that shows how it should call the event:

Any idea why this event isn’t being triggered? The fact there are no errors and it’s clearly getting right to the end of the node chain but still not firing is confusing.

If it helps, I was following this [tutorial][2].

Any assistance would be appreciated!

Cheers

I’m wondering whether it’s the Cast that doesn’t work. Try shoot off a print node from the Cast Failed output and put a breakpoint on that print.

Thanks for the reply, .

It was a good idea, but unfortunately the Print Text node going from Cast Failed never fires. I’d guess that because the Print Text after the Load Dialogue event should be triggered actually fires, the cast worked.

I’ve just put a breakpoint on the Load Dialogue event call and it does stop on that point when I click the button on the widget as it should.

Any other ideas?

Cheers

Maybe the target parameter of the dialogue node is incorrect?

Try use the “isValid” macro prior to putting the target in dialogue and see if that helps.

85871-isvalid.png

Hope that helps.

Thanks, . Good thinking on the isValid macro - Can’t believe I didn’t think of that!

It turns out that a function I had that created the Dialogue Actor viable wasn’t running, so I added it to the BeginPlay event, and it’s now working.

I have another problem with it now, but I’ll start another thread if I can’t work it out myself.

Thanks again for the debug help.

Cheers

I don’t see much point in thanking someone else and accepting that answer :slight_smile:

Oops, nearly did it a second time by mistake then. There you go mate, your answer is marked now :slight_smile: Thanks again!