Download

overriding UPawnSensingComponent functions

I am facing a strange behaviour I cannot debug. I am playing with the SensingComponent class. It contains two functions defined as:



virtual bool CouldSeePawn(const APawn* Other, bool bMaySkipChecks = false) const;
...
virtual void SensePawn(APawn& Pawn);


I am trying to override them so my class is as follows:



UCLASS()
class MYPROJECT_API UCancellaPawnSensingComponent : public UPawnSensingComponent
{
GENERATED_BODY()

public:
virtual bool CouldSeePawn(const APawn* Other, bool bMaySkipChecks = false) const override;
virtual void SensePawn(APawn& Pawn) override;
};


The implementation of the two functions is something like:



bool UCancellaPawnSensingComponent::CouldSeePawn(const APawn* Other, bool bMaySkipChecks) const
{
//my code here
}

void UCancellaPawnSensingComponent::SensePawn(APawn& Pawn)
{
//my code here
}


I have no compiling error. However, when I execute the project the original functions are executed, not the overridden version. I have tested with the “Local Windows Debugger” in Visual Studio and I can trigger breakpoints in the original code. Is there something obvious I am missing?