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.