How do i prevent a Projectile Movement Component to stop when it hits something?

I did this a while back and i think it works:

ProjectileMovement->OnProjectileStop.AddDynamic(this, &AProjectile::OnStop);

void AProjectile::OnStop(const FHitResult& Hit)
{
    ProjectileMovement->SetUpdatedComponent(CollisionComp);
    ProjectileMovement->Velocity = FVector(1000.0f, 0.0f, 0.0f);
    ProjectileMovement->UpdateComponentVelocity();
}
1 Like