IgnoredActors are ignored in ActorLineTraceSingle method call

I am on UE4.5 and following is my scenario.

  • I have an Actor(A1) with a collision
    component and custom collision
    profile.
  • A1 fires another actor (A2) with a
    collision component and custom
    collision profile.
  • A2 starts moving towards an object
    (thin Wire (W)) of type WorldStatic.
    Here is the problem, since A2 moves
    quite fast, sometime it skips the
    collision with W and pass through it.
    In order to avoid this tunnelling
    problem I was trying to use ray
    tracing by calling
    ActorLineSingleTrace on A2. The call
    seems to be working but it hits
    either A1 or A2 which is not the
    desired result. In the meantime I
    have the overlap behaviour setup for
    A2 and W and it works only 50% of the
    time.

I added A1 and A2 to IgnoredActors list inside FCollisionQueryParams but if I debug deep in ActorLineTraceSingle I see that IgnoredActors parameter is not used at all. Am I missing something?

Any help is appreciated!!

Here is my code:

    FHitResult hitResult;
    GetWorld()->DebugDrawTraceTag = "BulletTrace";
    FCollisionQueryParams collisionParams;
    TArray<AActor*> ignoredActors;
    AActor* source = const_cast<AActor*>(Cast<AActor>(GetSource()));
    ignoredActors.Add(source);
    ignoredActors.Add(this);
    collisionParams.AddIgnoredActors(ignoredActors);
    collisionParams.TraceTag = "BulletTrace";
    if(ActorLineTraceSingle(hitResult, currentLocation, futureLocation, ECC_WorldStatic, collisionParams))
    {
        //Take appropriate action
    }

I kept digging into this and found a solution :slight_smile:

Instead of using ActorLineTraceSingle I am using GetWorld()->LineTraceSingle() which actually does respect the IgnoredActors list passed to the FCollisionQueryParams.

I also setup a new trace channel for this purpose.