Search Unity

Using Animations as Triggers for Animations

Discussion in 'Animation' started by DannyDidit818, Jul 17, 2018.

  1. DannyDidit818

    DannyDidit818

    Joined:
    Jul 12, 2018
    Posts:
    8
    So, in my melee-focused game, I want my character to be unable to attack until their weapon is drawn.

    Until that happens, the character is only able to walk. Once the sword/weapon is drawn, I want regular walking to be disabled.

    Once the character is in 'melee stance', the only available movement options would be dashing, attacking, or a combination of the two.

    On top of this, the character cannot attack without blocking first (I.E, parrying) or dashing first (dash-attacking).

    Here's my question: how do I make the Animator recognize that certain commands are only available in certain 'stances'?
     
  2. gambitslacklines

    gambitslacklines

    Joined:
    Feb 23, 2015
    Posts:
    14
    If you move your player by code, you can just use a "If" statement to check if the player is in "melee stance" and use that for processing your movement or block it the way you want.

    If your Animations contain everything(rootmotion), just set a bool which tells the animator if it can transition to the next state or not, based on your "stance".
     
    DannyDidit818 likes this.
  3. DannyDidit818

    DannyDidit818

    Joined:
    Jul 12, 2018
    Posts:
    8
    I'll try that today, thanks!