Increase attack speed and animations
Hello,
I make a 2D beat'em up and I need your help for an issue I'm running about a gameplay feature.
The player have a skill which increase attack speed by 80%. So I have to do:
Increase attack speed by 80% which mean decreasing "attack duration" by 80%
Increase animation speed by 80%
I have a member variable called "attackDuration". In normal time, attackDuration = 1.5f
. In normal time, my attack animation fit perfectly the attackDuration (`animator.speed = 1.0f`).
With the attack speed buff, the attackDuration fall to 0.3f. In the same time, I set the animator speed to 1.8f. But for what I can see, my animation does not fit at all to my attack duration.
Is there a problem with animator.speed
? Someone running the same issue?
Thank you
EDIT: I logged the animation clip length:
Animator.speed = 1f => lenght = 1.5 sec
Animator.speed = 1.8f (+80%) => length = 0.8 sec
And for my attackduration:
Attackduration (normal time): 1.5 sec
Attackduration (+80% speed == multiplied by 0.2): 0.3 sec
Answer by Kakoha · Dec 19, 2021 at 11:25 AM
It's so sad to see that this question wasn't answered for more than 5 years. I have the same problem and I still have no idea how to solve it :( If I find a solution I'll come back and write it here for future viewers !
btw I fixed this two days ago. the problem is about the smooth transition that unity makes between animation. you can either make the next animation also fast, or remove the smooth transition. you can remove the smooth transition by clicking on the transition arrow and narrowing the blue thing down.