raycasting performance

hey guys, I am trying to develop a top down game. this game will have enemies, interactable items and ground. currently i am using GetHitResultUnderCursorByChannel with a custom trace channel for mouse interactions as I want to only interact with these 3 types of objects. Only these 3 objects block my custom trace channel. But my problem is that now i have to cast the hit actor to 3 different object i create. is this a good approach ?

sample code:



   //Hit contains information about what the raycast hit.
    FHitResult Hit;

    GetHitResultUnderCursorByChannel(UEngineTypes::ConvertToTraceType(ECollisionChannel::ECC_GameTraceChannel1), true, Hit);

    if (Hit.bBlockingHit)
    {    
        bool found = false;
        AMyEnemyCharacter* enemy = Cast<AMyEnemyCharacter>(Hit.GetActor());
        if (enemy)
        {
            UE_LOG(LogTemp, Warning, TEXT("Ray Hit ENEMY"));
            found = true;

            if (LastSelectedEnemy != enemy)
            {
                if (LastSelectedEnemy != nullptr)
                    LastSelectedEnemy->DeactivateOutline();

                enemy->ActivateOutline();
                LastSelectedEnemy = enemy;
            }
        }

        //if (found == false)
        //{
        //    // try casting to an interactable item

        //}

        //// if no enemies and items are under the mouse check for ground.
        //if (found == false && Mouse.Clicked)
        //{
        //    // check if a walkable ground is clicked
        //}

    }