Forward dash movement during attack animations

Hi. I added a slight forward dash movement in the attack animations.

Pull Request: https://github.com/UnityTechnologies/open-project-1/pull/472

electricrecentinchworm

The amount of dash movement can be customized within the Animation window, by using keyframes to change the value of Dasher.dashMagnitude.

I used this approach because it gives the designer frame-by-frame control of the dash amount, and can easily be synced to the character animation. It's also way easier to tune, in contrast to using some kind of root motion baked into the animation.

The yellow line and wire sphere at the foot of the character is used to visualize the dash amount that will be applied during that frame.

ariddeterminedcrownofthornsstarfish

The Dasher component doesn't actually do anything by itself, it just stores and exposes the dashMagnitude value.

The actual dash movement is done in the state action AddDashMovementActionSO. It just adds the computed Dasher.DashMovementVector property to Protagonist.movementVector. For this to work, AddDashMovement must be added to the appropriate states in the transition table. To avoid jerky movement, I had to add it to the following states: Idle, Walking, IdleAttacking, and WalkAttacking.

2 Likes

Very interesting implementation! I really like the debug sphere you added that shows the potential movement during an animation clip. Good job :clapping emoji: