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
Post a Comment