Search Unity

From idle to Attack and move left/right (Mecanim)

Discussion in 'Animation' started by Bukyja, Sep 18, 2013.

  1. Bukyja

    Bukyja

    Joined:
    Jul 7, 2013
    Posts:
    31
    Hello everyone, i'm trying to add attack and move left/right while in idlestate, i wrote this to pass from idle to attack animation with no luck. I'm not a programmer and i'm learning opening scripts and studying the logic inside so any help is a big help for me.

    Thats the code:

    if (currentBaseState.nameHash == idleState)
    {
    if (Input.GetKeyDown(KeyCode.Mouse0))
    {
    anim.SetBool("AttackIdle", true);
    }

    else

    {
    anim.SetBool("AttackIdle", false);
    }
    }

    and this is a animator's screenshot:

    $SS_Help.jpg