Someone else has problems with AddIgnoredActor() ?

Hello,

I’m using Unreal Engine 4.24.2 and the LineTrace doesn’t ignore my Actor.
Is that a bug?



AActor* ALineTrace::LineTraceSingle(FVector Start, FVector End)
{
    FHitResult HitResult;
    FCollisionObjectQueryParams CollisionParams;
    FCollisionQueryParams CollisionQueryParams;
    CollisionQueryParams.AddIgnoredActor(GetOwner());

    if (GetWorld()->LineTraceSingleByObjectType(
        OUT HitResult,
        Start,
        End,
        CollisionParams,
        CollisionQueryParams
    ))
    {
        return HitResult.GetActor();
    }

    return nullptr;
}


Found the problem…I inheritated from AActor instead from AActorComponent

There are issues.

The real problem is that the Physics scene is highly optimized to provide rapid resposes. The data is laid out spatially to provide constant time accesses.

The hits returned should be from using these optimized processess. IE: the filter and channels used. Not something UNREAL engineers added on top to fix the fact that they are all too lazy to actually set up the query channels properly. In effect, tossing out any reason for using NVidia’s highly optimized physics engine.

A proper solution involves setting up the proper collision response.

Are you using an Actor Component? If so then you will need to set the AddIgnoredActor to the Owner Reference. If that doesn’t work than I don’t know how to help you.