Hey Guys,
I have a problem with the OnOverlapBegin/End Event. I have a base class which derives from AActor and it should have the OnOverlapBegin/End function for base implementation of the function. But I got here a lot of unresovled external errors in derived classes or classes which implements the class.
Now I tried to implement the OnOverlapBegin/End function in a derived class and it seems to work there. So now my question is. Why does it work in the derived class and not in the base class? I will give u example code:
//this doesn't work
Uclass(abstract)
class (ProjectName)_API baseClass : public AActor
{
GENERATED_BODY()
public:
UFUNCTION()
void OnOverlapBegin(class UPrimitiveComponent* OverlappedComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult) ;
UFUNCTION()
void OnOverlapEnd(class UPrimitiveComponent* OverlappedComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex);
};
//this work (for sure here isn't the OnOverlapBegin/End function implemented in baseClass
Uclass(abstract)
class (ProjectName)_API derivedClass :public baseClass
{
GENERATED_BODY()
public:
UFUNCTION()
void OnOverlapBegin(class UPrimitiveComponent* OverlappedComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult) ;
UFUNCTION()
void OnOverlapEnd(class UPrimitiveComponent* OverlappedComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex);
};
does anybody know why this work? Because I don’t wanna have an abstraction level just for collision detection. The derived class has also some other dervied class from it so I don’t think it’s any kind of abstraction level here.