Created
October 19, 2015 03:16
-
-
Save boustrophedon/316d1dd390efa39e953c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach (NavMeshAgent a in agents) | |
{ | |
if (a.GetComponent<Animator>() != null) | |
{ | |
Animator anim = a.GetComponent<Animator>(); | |
anim.SetFloat("VSpeed", a.velocity.z); | |
anim.SetFloat("HSpeed", a.velocity.x); | |
if (Input.GetButtonDown("Fire3")) { | |
anim.SetBool("Running", true); | |
} | |
else if (Input.GetButtonUp("Fire3")) { | |
anim.SetBool("Running", false); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment