I can’t seem to get the capsule component to fire collision events.
Here’s the relevant code
GetCapsuleComponent()->bGenerateOverlapEvents = true;
GetCapsuleComponent()->OnComponentBeginOverlap.AddDynamic(this, &AUnRexCharacter::TriggerEnter);
And the actual function (which never gets fired):
void AUnRexCharacter::TriggerEnter(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Overlap With Character"));
if (OtherActor->IsA(AObstacleActor::StaticClass()))
SetActorLocation(StartingLocation);
}
I’ve checked all the editor settings, and my character’s capsule component collision profile is set to “Pawn”, and the other actor collision profile is set to “OverlapOnlyPawn”.