- Home /
Question by
theBuilder10000 · Apr 11, 2018 at 04:32 AM ·
animationanimatorattackrig
How to fix rig animation that stops short when increasing speed?
I have a character that swings an axe using animations on a rig. (The arm is made of multiple parts that are rotated through the animation). I need to make it swing faster, but increasing the speed of the animation causes the axe to stop short a millisecond after it starts an return to its original position. It seems like Unity is cutting short the animation to fit the time frame I want instead of increasing the speed of the animation. Heres the code that controls the axe.
if (Input.GetButtonDown ("Swipe") && timer <= .25f && carCollide.GetComponent ().levelWon == 0) {
timer = 1;
}
timer -= Time.deltaTime;
if (timer <= .99f && timer >= .5f) {
myAxe.SetActive (true);
axeTrail.SetActive (true);
} else {
myAxe.SetActive (false);
axeTrail.SetActive (false);
}
A parameter is set to timer and the swing begins when timer is greater than .75. The animation transitions back to default using Has Exit Time so it automatically returns without any parameters.
Comment