Added a full stop to the stop button and no input

This commit is contained in:
Gregory Campbell
2020-02-01 18:28:22 -05:00
parent 6bff24cc23
commit 2705a7f37c
+1 -6
View File
@@ -33,7 +33,6 @@ public class PlayerController : MonoBehaviour
private int wall = 0; private int wall = 0;
private int dive = 0; private int dive = 0;
private float maxSpeedStore; private float maxSpeedStore;
private float maxSpeedCap = 100;
private float accelerationStore; private float accelerationStore;
private float capsuleHeight; private float capsuleHeight;
private float controllerHeight; private float controllerHeight;
@@ -296,14 +295,10 @@ public class PlayerController : MonoBehaviour
//Remove or "lower" friction to add an 'ice' effect //Remove or "lower" friction to add an 'ice' effect
velocity.x = Mathf.SmoothDamp(velocity.x, 0.0f, ref xVelocity, friction); velocity.x = Mathf.SmoothDamp(velocity.x, 0.0f, ref xVelocity, friction);
velocity.z = Mathf.SmoothDamp(velocity.z, 0.0f, ref zVelocity, friction); velocity.z = Mathf.SmoothDamp(velocity.z, 0.0f, ref zVelocity, friction);
maxSpeed = 25;
} }
if(maxSpeed > maxSpeedCap)
{
maxSpeed = maxSpeedCap;
}
if(characterController.velocity == new Vector3(0, 0, 0)) if(characterController.velocity == new Vector3(0, 0, 0))
{ {
maxSpeed = maxSpeedStore; maxSpeed = maxSpeedStore;