Download

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.