|
@ -100,16 +100,12 @@ public class thirdPersonController : MonoBehaviour { |
|
|
|
|
|
|
|
|
applyGrip(); |
|
|
applyGrip(); |
|
|
|
|
|
|
|
|
//if (!slowed)
|
|
|
|
|
|
applyJump (jumpHeight); |
|
|
|
|
|
|
|
|
applyJump (jumpHeight); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
animator.SetBool ("Grounded", grounded); |
|
|
animator.SetBool ("Grounded", grounded); |
|
|
animator.SetFloat("Run speed",new Vector3 (rigidbody.velocity.x, 0.0f,rigidbody.velocity.z ).magnitude * Mathf.Sign(movementY)); |
|
|
animator.SetFloat("Run speed",new Vector3 (rigidbody.velocity.x, 0.0f,rigidbody.velocity.z ).magnitude * Mathf.Sign(movementY)); |
|
|
|
|
|
|
|
|
Vector3 side = transform.InverseTransformDirection (rigidbody.velocity).normalized; |
|
|
|
|
|
animator.SetFloat ("Side",side.x); |
|
|
|
|
|
|
|
|
|
|
|
rigidbody.AddForce (new Vector3 (0.0f, -9.81f,0.0f)); |
|
|
rigidbody.AddForce (new Vector3 (0.0f, -9.81f,0.0f)); |
|
|
|
|
|
|
|
|
curCollider = null; |
|
|
curCollider = null; |
|
@ -147,7 +143,6 @@ public class thirdPersonController : MonoBehaviour { |
|
|
if (movementY > 0 && this.name == "Player1") |
|
|
if (movementY > 0 && this.name == "Player1") |
|
|
movementY = 0; |
|
|
movementY = 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Vector3 velocity = new Vector3 (movementX, 0.0f, movementY) * curSpeed * Time.deltaTime; |
|
|
Vector3 velocity = new Vector3 (movementX, 0.0f, movementY) * curSpeed * Time.deltaTime; |
|
|
//Debug.Log (velocity);
|
|
|
//Debug.Log (velocity);
|
|
|