Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

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

  1. Bukyja


    Jul 7, 2013
    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);


    anim.SetBool("AttackIdle", false);

    and this is a animator's screenshot: