So basically I am trying to switch animator controllers for my player because it has a melee attack and a range attack. The melee attack and range attack have different animations. But the code in my script doesn’t seem to work.
This is the code:
if (UseSword == true) {
Sword.SetActive (true);
animator.runtimeAnimatorController = Resources.Load ("Assets/SpaceMan") as RuntimeAnimatorController;
Gun.SetActive (false);