As I have followed the example on screen and on the UE4 site I should have all the info entered correctly. However my forward position X is negative. I don’t know why that would be or even if I should care at this point. Any thoughts?
bool ATankPlayerController::GetSightRayHitLocation(FVector& HitLocation) const
{
//find the crosshair position in pixel coordinates
int32 ViewportSizeX, ViewportSizeY;
GetViewportSize(ViewportSizeX, ViewportSizeY);
auto ScreenLocation = FVector2D(ViewportSizeX * CrosshairXLocation, ViewportSizeY * CrosshairYLocation);
// Deproject the screen position, of the crosshair, to a world position
FVector CameraWorldLocation;
FVector WorldDirection;
if (DeprojectScreenPositionToWorld(ScreenLocation.X, ScreenLocation.Y, CameraWorldLocation, WorldDirection))
{
UE_LOG(LogTemp, Warning, TEXT("Look direction: %s"), *WorldDirection.ToString())
}