I purchase the Pro version after check the examples, but now im not sure how to manage the changes…
Actually I have 6 animatorOverrideController with BlendTrees inside for the player movement (every state have different animations based on weapon type, duals, 1H, 2H, Bow, etc)
What I do now, is, based on the weapon equiped, change the animatorOverrideController, and then for the attack, I change the clip of “attack1” animation, and then setTrigger(“Attack1”) to fire the animation what I want.
Im thinking in use the Hybrid system, keep my overrideControllers with the movement bledTree, change the controller in the Hybrid Animancer Component, and then execute the attack without any trigger only with the Crossfade(Attack)
This is because the blendTree for the 6 types, are many, not sure if Animancer have a better way to make blendTrees with this 6 cases without using Hybrid Component.
EDIT:
I get this working, but not sure if is “ok”, I get all controllers switch correctly and play animations with crossfade, INCLUSIVE I GET CROSSFADE BETWEEN AnimatorController changes… awesome.
With this, I change between AnimatorControllers, this keep mechanim working, creating Animancer new states, and setting active with PlayController();
animancer = baseModel.transform.GetComponent<HybridAnimancerComponent>();
RuntimeAnimatorController overrider = Resources.Load(aoc) as RuntimeAnimatorController;
characterController.animancer.Controller = overrider;
characterController.animancer.PlayController();
Then to play attacks I use this:
var state = animancer.CrossFade(ab.animations[0].animation);
state.OnEnd = OnAttackEnd;
private void OnAttackEnd()
{
animancer.PlayController();
}
This execute the animation, and crossfade back to the last AnimatorController()
Works perfect, now I only need to find how to put some animation in loop (to keep playing while the user keep pressed the key for example), but for now work like I want.
Only for the feature to change AvatarMask on fly the Animancer is a must have.
PD: With Unity 2019.3f1, I get an error in the Editor when load the HybridController component, I check the code and appear a problem with the calculation of the component window width, its easy to fix removing “B” from the line “var width = A + B”, only FYI.