Custom Player controlled Pawn Actor (Gravity issue)

Hi! I have been working on a custom pawn class for my player character. The Character class turned out to be insufficient for my ambitions on more andvanced prone functionality. I wanted this custom pawn to be as versatile as possible and decided that all the player input should be handled by the player controller class. That way the pawn can change from beeing controlled by a playerController to be controlled by a AIcontroller on runtime, So far I have been able to make the pawn move around correctly with help from the tutorial in the link. My code is quite different since all the input is beeing handled by the playerController and since I have some specifik needs for my project. As of now the Pawn floats in the air and is not affected by gravity. I read around a little and decided to try the following: I do a trace from the feet of the pawn with a very short length ( 2 units) facing down. If the trace hits something then the pawn is grounded. Else it adds a downward vector to the movement components inputVector.

However this solution generates two issues. the first is that the pawn is not accelerating down, rather falling down in a constant speed wich is very unrealistic. Am I better off adding a force to the pawn rather than using the movementcomponents input vector?
The second problem is with the trace. Since the trace begins at the feet and downwards it goes through the pawn itself. This should be easily fixed if I just set the trace to ignore the pawn, but since I am fairly new to C++ specifically and using it with Unreal, I am unsure how. I couldn’t find any good explanations to using traces with C++. Perhaps someone here would be kind enough to explain how CollisionQueryParams work.

this is the function I have written so far for the handling of gravity (inside my custom movement component class):


void UCustomPawnMovementComponent::UseGravity(FVector GravityDirection) {
    FHitResult* HitResult = new FHitResult();
    FVector StartPosition = GetActorFeetLocation();
    FVector EndPosition = StartPosition + FVector(0,0,-2);
    FCollisionObjectQueryParams* TraceParams = new FCollisionObjectQueryParams();    //fix: ignore self
    GEngine->AddOnScreenDebugMessage(2, 5.f, FColor::Red, FString::SanitizeFloat(StartPosition.X));
    DrawDebugLine(GetWorld(), StartPosition, EndPosition, FColor(255, 0, 0), false, 0, 1, 12.333);

    if (GetWorld()->LineTraceSingleByObjectType(*HitResult, StartPosition, EndPosition, *TraceParams)) {
        GEngine->AddOnScreenDebugMessage(3, 5.f, FColor::Red, TEXT("false"));
        IsInAir = false;
    }
    else {
        GEngine->AddOnScreenDebugMessage(3, 5.f, FColor::Red,TEXT("true"));
        IsInAir = true;
        AddInputVector(GravityDirection * 2);
    }
}