How Can I Override a BlueprintNativeEvent Function in a Component?

I have a component that inheriate from UMeshComponent.

I got a BlueprintNativeEvent Function, which represent the surface function. By default, this is a sphere surface.

I got code like this:

.h:



    UFUNCTION(BlueprintNativeEvent)
    void ImplicitSurfaceFunction(float x, float y, float z, float& result);
    virtual void ImplicitSurfaceFunction_Implementation(float x, float y, float z, float& result);


.cpp:



void USurfaceMeshComponent::ImplicitSurfaceFunction_Implementation(float x, float y, float z, float& result)
{
    result = (x*x) + (y*y) + (z*z) - 100.0f;
}


But… How can I override this function in blueprint?

Your UFUNCTION is missing the BlueprintCallable specifier. Like this:


UFUNCTION(BlueprintNativeEvent, BlueprintCallable)

Edit: Misread your post. You should be able to override it in the Blueprint Editor. Under functions there is an override button, in which it should show the method.

Just tried to do this and it seems it’s not possible:

These:

UCLASS()
class MY_API UMV_MyComponent : public UActorComponent
{
	GENERATED_BODY()

	UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, BlueprintAuthorityOnly)
	void MyFunction(const FGameplayTag& IncomingTag) const;

	UFUNCTION(BlueprintNativeEvent, BlueprintCallable, BlueprintAuthorityOnly)
	void MyFunctionNative(const FGameplayTag& IncomingTag) const;
	
}

Don’t show up here:
image

On 5.1. :frowning:

You would have to make a blueprint of the component and override it there. You can’t override component functions on the Actor that contains the component.

Then you add a component of the blueprint type to your actor instead of the native type.