OnComponentBeginOverlap doesn't work in base class

Hey Guys,
I have a problem with the OnComponentBeginOverlap() function.

I think I will show u in code what doesn’t work:

 // THIS CODE DOESN'T WORK
    
    //baseClass.h
    
    
    UCLASS(abstract)
    class (ProjectName)_API baseClass : public AActor
    {
    GENERATED_BODY()
    
    public: 
    UFUNCTION()
    void OnComponentBeginOverlap(class UPrimitiveComponent* OverlappedComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, 
    bool bFromSweep, const FHitResult& SweepResult); 
    };
    
    //baseClass.cpp
    void baseClass::baseClass::OnComponentBeginOverlap(class UPrimitiveComponent* OverlappedComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, 
    bool bFromSweep, const FHitResult& SweepResult) 
    {};
    
    //BUT THIS CODE WORKS
    //baseClass.h
    
    
    UCLASS(abstract)
    class (ProjectName)_API baseClass : public AActor
    {
    GENERATED_BODY()
    };
    
    //derivedClass.h
    UCLASS(abstract)
    class (ProjectName)_API derivedClass : public baseClass
    {
    public: 
    UFUNCTION()
    void OnComponentBeginOverlap(class UPrimitiveComponent* OverlappedComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, 
    bool bFromSweep, const FHitResult& SweepResult); 
    };
    
    //derivedClass.cpp 
    void derivedClass::derivedClass::void OnComponentBeginOverlap(class UPrimitiveComponent* OverlappedComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, 
    bool bFromSweep, const FHitResult& SweepResult)
    {}

    Now u see, there is the exakt same code in the derived class as in the base class. But the code in the derived class works. So I don't wanna have just one abstraction level for collision detection, maybe some work around here?

The error is unresolved external errors from all class inherit from baseclass. But the derivedClass also has some other derived classes from it. So it can't be the issue here.


why do you have “baseClass::baseClass::” only one should be necessary

usually " unresolved external errors " mean the function declared in .h is not found in .cpp ( to make it simple, it can be for some other reasons ) so double check your signature is the same and class name is good

could you share original code ? because error is probably a simple typo or something we can’t see on pseudo code :confused: