Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (isIdling == false) {
- if (Input.GetKey("space")) {
- gameObject.GetComponent<Rigidbody>().MovePosition(transform.position - transform.forward * (Time.deltaTime*(playerSpeed+3)));
- /* gameObject.GetComponent<Rigidbody>().velocity = -transform.forward*8; */
- anim.CrossFade("sprintAnim", 0.2f);
- } else {
- gameObject.GetComponent<Rigidbody>().MovePosition(transform.position - transform.forward * (Time.deltaTime*playerSpeed));
- /* gameObject.GetComponent<Rigidbody>().velocity = -transform.forward*6; */
- anim.CrossFade("runAnim", 0.2f);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement