So in the class version, we use DeprojectScreenPositionToWorld and discard the CameraWorlLocation. We then call
GetWorld()->LineTraceSingleByChannel(
HitResult,
StartLocation,
EndLocation,
ECollisionChannel::ECC_Visibility)
)
Here, we use PlayerCameraManager->GetCameraLocation for start location.
From my understanding, DeprojectScreenPositionToWorld creates a location vector and a direction unit vector based on a location from the 2D screen (i.e. a crosshair). GetCameraLocation gives a location vector for the camera. I logged the location of both
So my question is, would the value from DeprojectScreenPositionToWorld be more appropriate since it takes the aiming point into consideration where as the other just takes a general location of the camera. The difference seems small, but is definitely a factor, especially at long ranges.
The way I visualize the deproject location is the point marked by the aimingpoint just on the other side of the camera lense, whereas the camera position would be the center of the camera.