c# - Run new animation only when previous one is finished -


i'm new unity , i'm struggling configuring animations properly. have attack animation must played if press spacebar once , if hold it should play until release. problem once release spacebar animator instantly returns previous state. i've read answer on unity q&a site concerning script runs animations, don't use script run mine i'm setting them in animator. how can fix ? way change animation switching value of boolean variable :

     if(input.getkeydown(keycode.space))      {          isattacking = true;      }      if(input.getkeyup(keycode.space))      {          isattacking = false;      }      playeranimator.setbool("isattacking", isattacking); 

my project in 2d if matters.

click -> exit time

inside of animator have clips. clicking on clip bring inspector view. you'll want check has exit time'.

then you'll want set exit time 1 , transition duration 0.

by setting values, you're telling animator animation must finish before moving on next one.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -