- Home /
Question by
zki · Nov 15, 2017 at 06:19 AM ·
animationunityeditoranimator controlleranimation controller
How can i access animation from animator in unity3D
I want to perform some specific functionalities if my character is in Idle state and IdleUnarmed animation is playing and !anyKeyDown. I do not know how to access that "IdleUnarmed" animation from animator. The code i am using is
int idle = Animator.StringToHash("Base Layer.Locomotion.Free Locomotion.Free Locomotion.Idle.IdleUnarmed");
AnimatorStateInfo stateInfo = anim.GetCurrentAnimatorStateInfo(0);
if (!Input.anyKeyDown && stateInfo.GetHashCode() == idle)
{
if (Time.time > currentTime)
{
But it is not working. Anyone please help me to sort out this issue. Thank you
unity.png
(70.3 kB)
Comment