I’m developing a fighting game. The fighter has kicks, hit animation, and movement. About 40 different kicks and 10 hit animations.
I was able to separate the logic using a sub-state, but the number of transitions is still very large.
When I add a new kick, I have to manually adjust all the transitions from this stage, at this stage. Of 40 kicks, the transition to this kick. From movements to this kick, etc.
Is there any way to copy transitions or how to build logic differently?
I will be grateful if someone will share their experience or give advice.
Consider handling the major animator state changes in code and the minor ones using transition arrows.
Take a kick for example. The minor transitions might be:
[Start kick] → [Extend kick] → [Land]
Put these in a sub-state machine and handle the transitions using transition arrows.
In code, use Animator.CrossFade() to change to the [Start kick] state. Then let the transition arrows handle the transitions through [Extend kick] and [Land].
2 Likes
Thank you for this wonderful CrossFade() that I did not know, you saved me a lot of time
Glad I could help!
