Skip to content

Instantly share code, notes, and snippets.

@ThinhHB
Created June 1, 2016 06:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThinhHB/770e63929c3c94e5bc819bb846c1fc88 to your computer and use it in GitHub Desktop.
Save ThinhHB/770e63929c3c94e5bc819bb846c1fc88 to your computer and use it in GitHub Desktop.
//------- DO
const string JUMP_ANIMATOR_TRIGGER = "Jump";
[SerializeField] string walkAnimatorParameterName;// set it to "Jump" in Inspector
void Update()
{
_animator.SetTrigger(JUMP_ANIMATOR_TRIGGER);
_animator.SetTrigger(walkAnimatorParameterName);
}
//------- DONT
void Update()
{
_animator.SetTrigger("Jump");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment