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)
-1
View File
@@ -38,7 +38,6 @@ GraphicsSettings:
- {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16002, guid: 0000000000000000f000000000000000, type: 0}
m_PreloadedShaders: []
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
type: 0}
+2 -2
View File
@@ -278,7 +278,7 @@ InputManager:
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Mouse X
m_Name: Right Stick X
descriptiveName:
descriptiveNegativeName:
negativeButton:
@@ -294,7 +294,7 @@ InputManager:
axis: 3
joyNum: 0
- serializedVersion: 3
m_Name: Mouse Y
m_Name: Right Stick Y
descriptiveName:
descriptiveNegativeName:
negativeButton: