Last active
February 8, 2016 09:16
-
-
Save sylistine/c8a845f6c4f07f192720 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
Vector3 currentCameraPosition = cam.transform.position - (this.transform.position + lookOffset); | |
Vector3 currentCameraPositionXZ = new Vector3(relativeCameraPosition.x, 0, relativeCameraPosition.z); | |
float currentCameraPitch = Mathf.Atan2(currentCameraPosition.y, currentCameraPositionXZ.magnitude) * Mathf.Rad2Deg; | |
if (currentCameraPitch > maxCameraPitch) | |
{ | |
// This camera is too damn high! | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment