Fixed delayed standing slide and made standard horz/vert axis movement uniform across keyboard and joystick

This commit is contained in:
Gregory Campbell
2019-12-11 21:12:47 -05:00
parent e616fa50b2
commit de4da48e05
2 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -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);
+4 -4
View File
@@ -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