So basically I have method in interface, then have some base class that inherits from interface and implements base behaviour for certain type of actors and in the end there is actor itself(Let’s call it NotBase for simplicity).
Methods are implemented with BlueprintNativeEvent property so every definition has _Implementation at the end.
When I try to implement method in NotBase UE4 totally ignores my imlenentation and if there is definition in Base will call it if not won’t call method regardless code in NotBase
My class hierarchy:
Inteface->BaseClass->NotBaseClass
Code example(simplified for clarity)
Interface:
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "ItemInterface")
bool ActivateItem();
BaseClass.h:
virtual bool ActivateItem_Implementation() override;
BaseClass.cpp:
bool BaseClass::ActivateItem_Implementation()
{
UE_LOG(LogTemp, Warning, TEXT("a"));
return false;
}
NotBase.h
virtual bool ActivateItem_Implementation() override;
NotBase.cpp
bool NotBase::ActivateItem_Implementation()
{
UE_LOG(LogTemp, Warning, TEXT("aa"));
return true;
}
How method is called:
SomeComponent::Method()
{
NotBaseActor->Execute_ActivateItem(Base* NotBaseActor);
}
In this scenario i never get “aa” in log
Does anyone have an idea if I can do this, or will I have to use an interface without being able to implement it in BP?