How can i detect collision of custom actor when actor is moving

Hi. guys.

I want to detect collision of custom actor when actor is moving.

i tried a lot of method that i found at answerhub. but it’ not execute correctly.

Help me. please…

< I tried functions as follows : >

  1. Checking for collisions with AActor - C++ - Epic Developer Community Forums

  2. OnActorHit.AddDynamic(this, &AQAPawn::OnMyActorHit);

void MyActor::OnMyActorHit(AActor SelfActor, AActor OtherActor, FVector NormalImpulse, const FHitResult& Hit)
{
// to do smth
}

Not sure what all your needs are for your specific use case, but you should consider adding a UMovementComponent that you then extend and fully implement, if your custom actor moves a lot.

Then you set the UpdatedComponent of the MovementComponent to your custom Actors RootComponent or primary colliding component

Then you can use all of UE4’s existing systems to detect collision events.

You can also move the actor in a way that it will collide with world, see functions available in UMovementComponent.h

Rama