From de4da48e05eb3fef7f0efc5796eb045a83d43c09 Mon Sep 17 00:00:00 2001 From: Gregory Campbell Date: Wed, 11 Dec 2019 21:12:47 -0500 Subject: [PATCH] Fixed delayed standing slide and made standard horz/vert axis movement uniform across keyboard and joystick --- Assets/Scripts/PlayerController.cs | 6 +++--- ProjectSettings/InputManager.asset | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index 45416b5..b46d62b 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -42,7 +42,7 @@ public class PlayerController : MonoBehaviour float yStore = moveDirection.y; //Need to switch to 'raw' when using keyboard - moveDirection = (transform.forward * Input.GetAxis("Vertical")) + (transform.right * Input.GetAxis("Horizontal")); + moveDirection = (transform.forward * Input.GetAxisRaw("Vertical")) + (transform.right * Input.GetAxisRaw("Horizontal")); if (jump <= 1) { @@ -72,12 +72,12 @@ public class PlayerController : MonoBehaviour capsule.height /= 2; transform.localScale = new Vector3(transform.localScale.x, transformHeight/2, transform.localScale.z); - if(Input.GetKeyDown(KeyCode.LeftControl)) + if(Input.GetKeyDown(KeyCode.LeftControl) && characterController.velocity != new Vector3(0, 0, 0)) { startTime = Time.time; } - if(characterController.velocity != new Vector3(0, 0, 0) && startTime + oneSec >= Time.time) + if(startTime + oneSec >= Time.time) { moveDirection = (moveDirection.normalized * speed * 2); diff --git a/ProjectSettings/InputManager.asset b/ProjectSettings/InputManager.asset index 17c8f53..e844dcf 100644 --- a/ProjectSettings/InputManager.asset +++ b/ProjectSettings/InputManager.asset @@ -13,7 +13,7 @@ InputManager: positiveButton: right altNegativeButton: a altPositiveButton: d - gravity: 3 + gravity: 1000 dead: 0.001 sensitivity: 3 snap: 1 @@ -29,7 +29,7 @@ InputManager: positiveButton: up altNegativeButton: s altPositiveButton: w - gravity: 3 + gravity: 1000 dead: 0.001 sensitivity: 3 snap: 1 @@ -157,7 +157,7 @@ InputManager: positiveButton: altNegativeButton: altPositiveButton: - gravity: 0 + gravity: 1000 dead: 0.19 sensitivity: 1 snap: 0 @@ -173,7 +173,7 @@ InputManager: positiveButton: altNegativeButton: altPositiveButton: - gravity: 0 + gravity: 1000 dead: 0.19 sensitivity: 1 snap: 0