Last active
August 28, 2016 01:40
-
-
Save DarkDesire/ec44aad3c7301476169bb3f40f7b9b75 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define OUT | |
// Used for saving ViewPortLocation | |
FVector PlayerViewPointLocation; | |
// Used for saving ViewPortRotation | |
FRotator PlayerViewPointRotation; | |
void GetPlayerViewPort(){ | |
GetWorld()->GetFirstPlayerController()->GetPlayerViewPoint( | |
OUT PlayerViewPointLocation, | |
OUT PlayerViewPointRotation ); | |
} | |
FVector GetReachLineEnd(){ | |
GetPlayerViewPort(); | |
return PlayerViewPointLocation + (PlayerViewPointRotation.Vector() * Reach); | |
} | |
/// Drawing a red debug line | |
DrawDebugLine( GetWorld(), PlayerViewPointLocation, GetReachLineEnd(), FColor( 255, 0, 0 ), false, 0.f, 0, 2.f ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment