diff --git a/Assets/Prefabs/Input/Player.prefab b/Assets/Prefabs/Input/Player.prefab index a4ed306ca..838d3d242 100644 --- a/Assets/Prefabs/Input/Player.prefab +++ b/Assets/Prefabs/Input/Player.prefab @@ -68,7 +68,7 @@ MonoBehaviour: leapForce: 12.5 jumpTimeout: 0.5 leapTimeout: 0.875 - crouchedHeightOffset: 0.3 + crouchedHeightOffset: 0.8 airThreshold: 0.4 slopeAngleThreshold: 50 state: 1 @@ -177,6 +177,7 @@ MonoBehaviour: m_EditorClassIdentifier: maxHitDistance: 100 targetStartOffset: 0.9 + overrideAimTarget: 0 inputManager: {fileID: 0} identity: {fileID: 0} hudController: {fileID: 555885729091202788} diff --git a/Assets/Scripts/Control&Input/InputManager.cs b/Assets/Scripts/Control&Input/InputManager.cs index c1c71dac9..c14f5d02f 100644 --- a/Assets/Scripts/Control&Input/InputManager.cs +++ b/Assets/Scripts/Control&Input/InputManager.cs @@ -43,6 +43,8 @@ public class InputManager : MonoBehaviour [SerializeField] private float mouseLookScale = 0.1f; + [SerializeField] + private float gamepadLookScale = 0.75f; private bool isMouseAndKeyboard = false; @@ -130,7 +132,7 @@ private void LookInputPerformed(InputAction.CallbackContext ctx) } else { - lookInput = ctx.ReadValue(); + lookInput = ctx.ReadValue() * gamepadLookScale; } } diff --git a/Assets/Scripts/Control&Input/PlayerMovement.cs b/Assets/Scripts/Control&Input/PlayerMovement.cs index bc4b8afc7..47ccf2214 100644 --- a/Assets/Scripts/Control&Input/PlayerMovement.cs +++ b/Assets/Scripts/Control&Input/PlayerMovement.cs @@ -130,18 +130,18 @@ private void SetCrouch(InputAction.CallbackContext ctx) if (ctx.performed) { + if (IsInAir()) + return; animator.SetBool("Crouching", true); strafeForce = strafeForceCrouched; - if (!IsInAir()) - inputManager.gameObject.LeanMoveLocalY(localCameraHeight - crouchedHeightOffset, 0.2f); + inputManager.gameObject.LeanMoveLocalY(localCameraHeight - crouchedHeightOffset, 0.2f); } if (ctx.canceled) { animator.SetBool("Crouching", false); strafeForce = strafeForceGrounded; - if (!IsInAir()) - inputManager.gameObject.LeanMoveLocalY(localCameraHeight, 0.2f); + inputManager.gameObject.LeanMoveLocalY(localCameraHeight, 0.2f); } } @@ -200,6 +200,7 @@ private void UpdatePosition(Vector3 input) var groundNormal = GroundNormal(); var direction = Vector3.ProjectOnPlane(input, groundNormal); body.AddForce(direction * strafeForce, ForceMode.VelocityChange); + body.AddForce(direction * strafeForce, ForceMode.Impulse); if (IsInAir()) state = PlayerState.IN_AIR; break; }