Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sephirot47/466e29c7cded26d72ae2 to your computer and use it in GitHub Desktop.
Save sephirot47/466e29c7cded26d72ae2 to your computer and use it in GitHub Desktop.
UE4 Get Camera Location or Position and Forward Vector (useful for Tracing)
APlayerCameraManager *camManager = GetWorld()->GetFirstPlayerController()->PlayerCameraManager;
FVector camLocation = camManager->GetCameraLocation();
FVector camForward = camManager->GetCameraRotation().Vector();
@SupreetoSaha
Copy link

Thanks a lot :)

@pold500
Copy link

pold500 commented Jun 22, 2022

Thanks man!

@jukrb0x
Copy link

jukrb0x commented Jun 28, 2022

CameraManager = UGameplayStatics::GetPlayerCameraManager(GetWorld(), 0);

@RandomExplosion
Copy link

Also Works in ue5

@MasterAirscrachDev
Copy link

still works in UE5, thanks!

@julisinjuly
Copy link

thank you very much!! Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment