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?

1 Like

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: https://www.youtube.com/watch?v=k-MAALv3P-Y

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.

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

On the project

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

2 Likes

First, you need to configure the inputs for the custom event accordingly.

Here’s how to do it:

  • Add a custom event;
  • In the details pane, find the “Inputs” section and fill it out according to the specification of the event you want to bind;
  • If you followed the previous step correctly, you can now connect your “Custom Event” to the “Binding Event”.
1 Like

When I got this error, I had created a new event first, then tried to connect it to the “Event” pin on the left of a node.

The problem was the event I’d made took no arguments/inputs, so it didn’t match the signature that pin was looking for.

Instead of creating my events directly, what I did was drag from that Event pin out to the left, then choose “Add Event > Add Custom Event” from the context menu that pops up. That created an event that had the correct inputs/arguments by default, so I didn’t have to set them up to match.

1 Like