Download

Error while using FCollisionQueryParams in a custom trace function.

Hi there,

I want to create a CustomTraceFunction and use it inside my actor multiple times so I implemented this:

header:


UFUNCTION()
    bool CustomSingleLineTrace(const FVector& Start, const FVector& End, const FCollisionQueryParams& Params);

cpp:


bool AMyActor::CustomSingleLineTrace(const FVector& Start, const FVector& End, const FCollisionQueryParams& Params)
{
    UE_LOG(LogTemp, Warning, TEXT("Custom Trace"));
    return true;
}

and included “CollisionQueryParams.h” in cpp and header.

But my code has a error in compile like this:
Error Unrecognized type ‘FCollisionQueryParams’ - type must be a UCLASS, USTRUCT or UENUM

Can you tell me what is my problem here?

Thank you