I’m working on the prototype of a platform fighter (think Super Smash Bros, Rivals of Aether, etc), and as is normal for the genre, I’ve got a “skid” animation when my character turns around during a dash. I.e. the code looks like:
if (animator.GetCurrentAnimatorStateInfo(0).IsName(“Dash”) && Input.GetAxisRaw(“Horizontal”) < -0.5) {
animator.SetTrigger(“DASH_TURNAROUND”);
//Do the rest of the turning around
} else{
animator.ResetTrigger(“DASH_TURNAROUND”);
}
I’ve got a couple of specific requirements for this. On the first frame the turnaround animation is initiated, I need my character to be considered facing the opposite direction (if I want to jump out of the turnaround, for example, I should instantly be facing the other way). However, I also need the entire animation to carry out, as obviously if I just rotated my character 180 degrees as soon as DASH_TURNAROUND was activated I’d end up facing the same direction I started. Is there an elegant solution to this? I’ve searched without much success and any help is appreciated.