The test has now gone from just an idea to something that works:
The topmost state machine
There is an addition of a WeaponExit state that deals with quickly blending away the held weapon and get to a generic default pose.
The transitions from WeaponExit are set to have blendduration of 0,
These extra steps are to make sure the weapon states are reset by being fully blended out first
The weapon state machine got a new End state signaling that you have reached the end of a branch
The attack animations do have Notifies now:
- onSubState1Passed signaling the end of the anticipation frames and the beginning of the attack (this is when the weapon can start do damage)
- onSubState2Passed signaling the end of the attack frames and the beginning of the cooldown frames (this is when the weapon can not do damage anymore)
- onAttackEnd signaling the end of the attack that will cause a transition to WeaponExit state if no attack is buffered up
Finally there is a PulseMoveCurve that acts a bit like root-motion and specifies the desired speed forward.