I’m trying to use a hash because I saw a video that the hash is faster. This code works but it doesn’t use a hash
A sound is played when my axe collides with a tree and my current animation state is “choppingTree”
AnimatorStateInfo info;
info = playerAnimator.GetCurrentAnimatorStateInfo(0);
if (info.IsName("choppingTree") == true)
ads.Play();
this code doesn’t work
AnimatorStateInfo info;
int choppingTreeHash = Animator.StringToHash("choppingTree");
info = playerAnimator.GetCurrentAnimatorStateInfo(0);
if (info.fullPathHash == choppingTreeHash)
ads.Play();