Advertisement
RealiteeeyyyyTV

Untitled

Jan 7th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class StrafeRRun : MonoBehaviour {
  5.  
  6.  
  7. public Animator anim;
  8.  
  9. public KeyCode Walking;
  10.  
  11. public bool isWalkingForward;
  12.  
  13. void Start () {
  14.  
  15. }
  16.  
  17.  
  18. void Update ()
  19. {
  20. if (Input.GetKeyDown (Walking) && !isWalkingForward);
  21. {
  22. isWalkingForward = true;
  23. }
  24.  
  25. if (Input.GetKeyUp (Walking) && isWalkingForward)
  26. {
  27. isWalkingForward = false;
  28. }
  29. anim.SetBool ("StrafeRRun", isWalkingForward);
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement