Hi folks,
currently I am working on a 2D action RPG (top down). Ever since I started I tried to make everything as flexible as possible.
When it comes to animations I never found a good solution to my problem.
Since I want the player to be able to charge his attacks I split up the attack animations into several sub-animations: start, charge, release. Somewhere in release I want a projectile to be spawned. I really don’t like AnimationEvents since they are easy to overlook and therefore error-prone (in my opinion).
Now the problem is that the Animator gets huge (and messy) with like 5 attacks (with 3 sub-animations each), doding, picking up items, dying, being dead, getting hurt, etc. pp. Mostly many Animations are attached to nearly each other animation (e.g. changing state from charging an attack into doding). I also have one Animator for each character. Other characters override this Animator with their own animations.
Currently I have a StateMachineBehaviour on each AnimationState in Mechanim for the animations that calls a MonoBehavior about it’s current state (e.g.: State: ChargeAttack, TimeInState: x seconds). Then in a coroutine I check the current state and e.g. spawn a projectile at a certain time (or start making the player invincible for doding).
In short: how whould you approach many animations in the Animator and a flexible solution with Animations especially with split up animations? I want to be able to easily swap animations or variables for Animations (e.g. animation speed). And is there some best practices to keep complexity to the Animator to a minimum?
Thanks,
Fury