Raycasting A 2D Point in the World

Try this

UPlayerController* PlayerController = ...
PlayerController->DeprojectScreenPositionToWorld(ScreenX, ScreenY, OutWorldLocation, OutWorldDirection);

More info on: >DeprojectScreenPositionToWorld<

OutWorldLocation and OutWorldDirection is your ray that you can shoot from the scene. You can check if it hits a plane with this API

FPlane PlaneToHit = FPlane(FVector(0, 0, 0), FVector(-1, 0, 0));
FVector WorldHitPosition = FMath::RayPlaneIntersection(OutWorldLocation, OutWorldDirection, PlaneToHit);