Advertisement
Guest User

Untitled

a guest
Jan 17th, 2020
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1.         if (isIdling == false) {
  2.             if (Input.GetKey("space")) {
  3.                 gameObject.GetComponent<Rigidbody>().MovePosition(transform.position - transform.forward * (Time.deltaTime*(playerSpeed+3)));
  4.                 /* gameObject.GetComponent<Rigidbody>().velocity = -transform.forward*8; */
  5.                 anim.CrossFade("sprintAnim", 0.2f);
  6.             } else {
  7.                 gameObject.GetComponent<Rigidbody>().MovePosition(transform.position - transform.forward * (Time.deltaTime*playerSpeed));
  8.                 /* gameObject.GetComponent<Rigidbody>().velocity = -transform.forward*6; */
  9.                 anim.CrossFade("runAnim", 0.2f);
  10.             }
  11.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement