twoski
1
I thought it would be possible to change the animator controller for an Animator component through code but it doesn’t seem possible.
What is the best way to accomplish this? I have 3 different animator controllers and i want to assign any of them to my animator on the fly.
This is definitely possible, I’ve been doing this to change the crosshair’s animator controller when different weapons are used:
crosshair.GetComponent<Animator>().runtimeAnimatorController = weapon.GetComponent<GunController>().CrosshairAnimatorController;
where the weapon just has a public variable that holds on to its own animator controller.
1 Like