Thanks a lot~ Your code gives me inspiration and I have resolved my problem.
Here I get the ViewInfo of my current camera.
FMinimalViewInfo MinimalViewInfo = FMinimalViewInfo();
MinimalViewInfo.Location = CineCamera->GetComponentLocation();
MinimalViewInfo.Rotation = CineCamera->GetComponentRotation();
MinimalViewInfo.FOV = CineCamera->FieldOfView;
MinimalViewInfo.DesiredFOV = CineCamera->FieldOfView;;
MinimalViewInfo.AspectRatio = CineCamera->AspectRatio;
FMatrix ViewMatrix;
FMatrix ProjectionMatrix;
UGameplayStatics::GetViewProjectionMatrix(MinimalViewInfo, ViewMatrix, ProjectionMatrix, ViewProjectionMatrix);
And I use the ViewProjectionMatrix like this to get the 2D screenPos.(SocketWorldLocation is the 3D pos I want to project)
FVector2D ScreenPos;
FIntRect InRect(0, 0, 1920, 1080);
FSceneView::ProjectWorldToScreen(SocketWorldLocation, InRect, ViewProjectionMatrix, ScreenPos);