Collision event not firing

Hi there,

i have an actor with which is overriding ReceiveHit(…)

When I hit the actor with the pawn, ReceiveHit gets called.

When the actor hits a boxtrigger (collision settings: block all), ReceiveHit doesn’t get called.

It would be nice if i could get the Hit event from the box :slight_smile:

thanks in advance :slight_smile:

edit:
When i set the

CollisionComponent->SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Block);

to

CollisionComponent->SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Overlap);

i get overlap events. This is weird because all the other objects which this one is colliding with, are set to "block all
" One of those objects has not checked the Generate overlap events, but I’m getting overlap events on this object.

When the actor is set to “block all” there is no collision but with pawn and i dont get the overlap events.

Funny is that when i set simulate physics true the actor gets stopped by the objects but i dont get a ReceiveHit…
can somebody tell me whats going on here?
something is weird…

edit:

##More clear version:

Ball Header

virtual void ReceiveActorBeginOverlap(AActor* OtherActor) override;
virtual void ReceiveActorEndOverlap(AActor* OtherActor) override;
virtual void ReceiveHit(class UPrimitiveComponent* MyComp, AActor* Other, class UPrimitiveComponent* OtherComp, bool bSelfMoved, FVector HitLocation, FVector HitNormal, FVector NormalImpulse, const FHitResult& Hit) override;

##Ball CPP
void AG1Ball::ReceiveHit(class UPrimitiveComponent* MyComp, AActor* Other, class UPrimitiveComponent* OtherComp, bool bSelfMoved, FVector HitLocation, FVector HitNormal, FVector NormalImpulse, const FHitResult& Hit)
{
Super::ReceiveHit(MyComp, Other, OtherComp, bSelfMoved, HitLocation, HitNormal, NormalImpulse, Hit);
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Blue, TEXT(“BALL HIT”));
}

void AG1Ball::ReceiveActorBeginOverlap(AActor* OtherActor)
{
	GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Blue, TEXT("OVERLAP BEGIN"));
}

void AG1Ball::ReceiveActorEndOverlap(AActor* OtherActor)
{
	GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Blue, TEXT("OVERLAP END"));
}

##Ball Constructor
CollisionComponent = PCIP.CreateDefaultSubobject(this, TEXT(“SphereComp”));
CollisionComponent->InitSphereRadius(30.0f);
CollisionComponent->SetCollisionObjectType(ECC_WorldDynamic);
CollisionComponent->SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Block);
CollisionComponent->SetCollisionEnabled(ECollisionEnabled::Type::QueryOnly);
RootComponent = CollisionComponent;


##Static Mesh in scene settings 1

Static Mesh in scene settings 2


##Problem
The ball moves through the actor in the scene. None of the events (hit,overlap) get called.

##Additional info
I have a Pawn with the same settings as the static object in the scene.

If the pawn is not moving no event gets called.

If the pawn is moving the Hit event gets called.

##Questions
Should i use virtual ReceiveHit / ReceiveActorBeginOverlap … or should i use something like

CollisionComponent->OnComponentHit.AddDynamic(this, &AG1Ball::OnHit);

Should i enable simulate physics on the static mesh or ball (ball is not falling its just moving)?

its pretty simple:

##Problem
SetActorLocation(GetActorLocation() + Velocity * 0.005f);

##Solution
SetActorLocation(GetActorLocation() + Velocity * 0.005f, true);