Implemented a fix for the right stick being so slow when playing a build

This commit is contained in:
Gregory Campbell
2020-02-03 18:17:50 -05:00
parent f874f7fcd0
commit a0409f6beb
3 changed files with 17 additions and 10 deletions
+15 -7
View File
@@ -26,21 +26,29 @@ public class CameraController : MonoBehaviour
void LateUpdate(){
float camX = 0;
float camY = 0;
float mouseCamX = 0;
float mouseCamY = 0;
float controllerCamX = 0;
float controllerCamY = 0;
if(!PauseMenu.GameIsPaused)
{
camX = Input.GetAxisRaw("Mouse X") * rotateSpeed;
camY = Input.GetAxisRaw("Mouse Y") * rotateSpeed;
mouseCamX = Input.GetAxisRaw("Mouse X") * rotateSpeed;
mouseCamY = Input.GetAxisRaw("Mouse Y") * rotateSpeed;
controllerCamX = Input.GetAxisRaw("Right Stick X") * (rotateSpeed * 200.0f) * Time.deltaTime;
controllerCamY = Input.GetAxisRaw("Right Stick Y") * (rotateSpeed * 200.0f) * Time.deltaTime;
}
pivot.Rotate(0, camX, 0);
pivot.Rotate(0, mouseCamX, 0);
pivot.Rotate(0, controllerCamX, 0);
if (invertY){
pivot.Rotate(camY, 0, 0);
pivot.Rotate(mouseCamY, 0, 0);
pivot.Rotate(controllerCamY, 0, 0);
} else {
pivot.Rotate(-camY, 0, 0);
pivot.Rotate(-mouseCamY, 0, 0);
pivot.Rotate(-controllerCamY, 0, 0);
}
if(pivot.rotation.eulerAngles.x > maxViewAngle && pivot.rotation.eulerAngles.x < 180f)