BlueprintImplementableEvent with void return not working

#Friendly Name

Try including a friendly name!

/** My comment*/
	UFUNCTION(BlueprintImplementableEvent, meta=(FriendlyName = "My Happy Event"))
	virtual void BPEvent_MyEvent();

If I write a function that returns void and try to make it a BlueprintImplementableEvent like this:

UFUNCTION(BlueprintImplementableEvent)
void SpawnPawn();

It doesn’t show up in the editor as overridable. But if I change the return type to something else (such as bool):

UFUNCTION(BlueprintImplementableEvent)
bool SpawnPawn();

It shows up no problem.

Hi Lambda42,

Could you provide some more information about this issue? I tried doing a quick setup using a new project from the First Person template in 4.3.1 and actually had the opposite effect to what you described. I added the first code snippet you posted into the header for the character class, then opened the character Blueprint and was able to place a node for the event. When I changed it to the second code snippet, the node was not available in the Blueprint graph.

What version of the Engine are you using, and are you using the Engine from binaries installed by the Launcher or did you build it from source code? Does this happen for you only in your project? If you can get it to happen in a new project using one of the templates, could you provide the exact steps you are following so I can reproduce it?

Actually, I believe I misunderstood what you were looking for. I took another look and I see what you were describing. I will get in touch with the development team and find out what the intended functionality is in this case.

Hi Lambda42,

I spent some time today going over BlueprintImplementableEvents with a few of the developers, and it appears that what you are currently seeing is actually correct. If you do not have a return value in the class declaration, the Editor treats it as a simple event that can be triggered and which starts executing a sequence of nodes. It does not have any real inherent “functionality,” and therefore you cannot change the event itself, only the resulting nodes that it triggers.

However, if you include a return value in the declaration, the Blueprint will treat it as if it were a function, since it expects that you will want to include some logic to determine the value that will be returned when the event is triggered. In the case of a bool return value, for example, you will want to determine whether the event returns true or false when it is triggered. That is why it appears as an overridable function in this case.

Thanks for the explanation!

The first BlueprintImplementableEvent I created just happened to have a return value. When I created this one, I just expected it to show up in the same way in the editor. I didn’t even think to look in the event graph.