Implemented a fix for the right stick being so slow when playing a build
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user