BlueprintNativeEvent and BlueprintImplementableEvent with void functions not working

UFunctions annotated with BlueprintNativeEvent or BlueprintImplementableEvent that don’t have a return type (return void) cannot be implemented in blueprints.
This is very obvious in UMG UserWidget implementing blueprints. OnMouseEnter, OnMouseLeave, onkeyboardlostfocus… return void, and can’t be implemented in blueprints.

This is a serious issue. Either Fix it to be able to implement void functions, or change return type to something other than void for all functions meant to be implementable in blueprints.

Thanks

Hi

What version of the Engine are you using, and are you using the binary version installed through the Launcher or did you build the Engine from source code? Could you provide some steps to reproduce the issue?

I’m using 4.5preview from Launcher, but this issue was present in 4.4 Launcher version too.
Create a new UMG Blueprint widget based on UserWidget (default). go to graph editor of the widget and expand Mouse category in the functions and variables list. Look at the overridable functions, Mouse category and notice that OnMouseEnter, OnMouseLeave, and other methods with void return type are not present, hence can’t be implemented.

But they are present in the source code

UFUNCTION(BlueprintNativeEvent, Category="Mouse") void OnMouseEnter(FGeometry MyGeometry, const FPointerEvent& MouseEvent); UFUNCTION(BlueprintNativeEvent, Category="Mouse") void OnMouseLeave(const FPointerEvent& MouseEvent);

This is also easy to replicate with own UFUNCTIONS. Add a c++ class to the project, extend from UserWidget (although anything can work here since this is not only related to UMG), add a UFUNCTION

UFUNCTION(BlueprintNativeEvent, Category = "TestCat") void SomeTestFunction(const bool TestVar) ;

add an implementation, compile, go to the blueprint notice the function is not there.
change return type to something other than void

UFUNCTION(BlueprintNativeEvent, Category = "TestCat") bool SomeTestFunction(const bool TestVar) ;

fix implementation, compile, reload project (hot reload doesn’t seem to refresh the functions list in the blueprint so a full reload of the editor is needed) and notice the function now appears.

Edit: Sorry about the formatting, not sure why it puts everything on the same line in the code block.

Hi

I apologize for not getting back to you sooner on this issue. I just realized that I had never followed up on it. I wanted to let you know that I have confirmed the issue that you described, and there is a ticket in place to have this investigated further (UE-6995).

Hi

I just wanted to provide a follow-up on this issue. It appears I was looking into this issue from the wrong angle. Functions and events with no return values are currently working as intended. These are able to be overridden by placing them as events in the Event Graph (from the right-click context search).