Made turning for the player much tighter and less slidey/icy
This commit is contained in:
@@ -2310,7 +2310,7 @@ MonoBehaviour:
|
||||
lives: 3
|
||||
maxSpeed: 25
|
||||
acceleration: 0.5
|
||||
friction: 0.1
|
||||
friction: 1
|
||||
jumpHeight: 20
|
||||
gravity: 5
|
||||
rotationSpeed: 20
|
||||
|
||||
@@ -3898,7 +3898,7 @@ MonoBehaviour:
|
||||
lives: 3
|
||||
maxSpeed: 25
|
||||
acceleration: 0.5
|
||||
friction: 0.1
|
||||
friction: 1
|
||||
jumpHeight: 20
|
||||
gravity: 5
|
||||
rotationSpeed: 20
|
||||
|
||||
@@ -2510,7 +2510,7 @@ MonoBehaviour:
|
||||
lives: 3
|
||||
maxSpeed: 25
|
||||
acceleration: 0.5
|
||||
friction: 0.1
|
||||
friction: 1
|
||||
jumpHeight: 20
|
||||
gravity: 5
|
||||
rotationSpeed: 20
|
||||
|
||||
@@ -2246,7 +2246,7 @@ MonoBehaviour:
|
||||
lives: 3
|
||||
maxSpeed: 25
|
||||
acceleration: 0.5
|
||||
friction: 0.1
|
||||
friction: 1
|
||||
jumpHeight: 20
|
||||
gravity: 5
|
||||
rotationSpeed: 20
|
||||
|
||||
@@ -299,12 +299,16 @@ public class PlayerController : MonoBehaviour
|
||||
if((Input.GetAxis("Horizontal") == 0 && Input.GetAxis("Vertical") == 0) || (Input.GetButton("Stop") || Input.GetAxis("Stop") == 1.0f)){
|
||||
|
||||
//Remove or "lower" friction to add an 'ice' effect
|
||||
velocity.x = Mathf.SmoothDamp(velocity.x, 0.0f, ref xVelocity, friction);
|
||||
velocity.z = Mathf.SmoothDamp(velocity.z, 0.0f, ref zVelocity, friction);
|
||||
velocity.x = Mathf.SmoothDamp(velocity.x, 0.0f, ref xVelocity, 0.1f);
|
||||
velocity.z = Mathf.SmoothDamp(velocity.z, 0.0f, ref zVelocity, 0.1f);
|
||||
maxSpeed = 25;
|
||||
|
||||
}
|
||||
|
||||
//Remove or "lower" friction to add an 'ice' effect
|
||||
velocity.x = Mathf.SmoothDamp(velocity.x, 0.0f, ref xVelocity, friction);
|
||||
velocity.z = Mathf.SmoothDamp(velocity.z, 0.0f, ref zVelocity, friction);
|
||||
|
||||
if(characterController.velocity == new Vector3(0, 0, 0))
|
||||
{
|
||||
maxSpeed = maxSpeedStore;
|
||||
|
||||
Reference in New Issue
Block a user