Download

Delegate is not compatible with delegate (by ref)

I want the game mode to respawn the player after certain amount of time when the OnDestroyed event is fired from within the BH_Character…

But whenever I use the delegate pin on my custom event to OnDestroyed I get this error:

Can somebody please help me with this?

Because your event doesn’t have an entry parameter I believe.

use the node “Create Event” and choose your corresponding Event

I can do this fine in 4.11.2:

but not in 4.12.5 which I am using for the project. (I knew I had done this before).

Somebody help please?

I’m not sure why that happens, it most likely has to do with the way the OnDestroyed delegate is declared in C++. But you can easily fix it by using “Assign On Destroyed” on the blueprints creation menu instead of “Bind to On Destroyed.” What Assign does is bind the delegate and create a proper event that will be accepted.

I am having a similar issue, also with 4.12.5. I’m following this tutorial here: UE4 Event Dispatchers - YouTube

But when I try to plug the red wire from my custom event (level blueprint) into the bind event, I get the “Delegate is not compatible with delegate (by ref)” error. :frowning:

All I want to do is update the number of lives left, which the player pawn is keeping track of. This seems like something that should be easy to do.

-edit Figured it out. Was trying to create a new custom event in my level blueprint, not hunt for the one in the right-click menu, durrr.

This is what the graph should look like after you do what Infiltrator suggested.
3f148184670d68f28b4d062ffc4c5ed9afd05df5.png

Basically, spawn an Assign OnDestroy node. Then delete the assign ondestroy node and keep the custom event. Wire up to the Bind Even to OnDestroy node you have already on your screen. Delete the character respawn you have at the end of your Character_Respawn critical execution path, and then drag the execution pin out of the posses output, and spawn the Character Respawn event again. Wire up the Destroyed Actor nodes, and kablamo.

I’m using the same book (as far as I know) to learn UE4 and I’m having the same problem.

Aha. This helps a lot. Apparently the book I was using did it in the wrong order.
I’m using
Unreal Engine 4.X By Example
An example-based practical guide to get you up and running with Unreal Engine 4.X
Benjamin Carnall

On the project
Barrel Hopper

Has this ever been solved? I’m trying to get the FaceAR Sample to run with a custom character in a new Project.

@Sen3D Yes, if you “assign” instead of “Bind to”, it will make a custom event for you with the reference on it