Hi there, I'm developing a game in which the main character has two modes. A small size, and big size (check photo). And in both of them, the animations are all the same name, all the same parameters and the same code controls them.
I have achieved the switch I'm looking for, but it causes a small spike in performance each time it is called, and I'm wondering if there's a way to do it better without the performance loss.
Preview:

The code I'm using to make it work is this:
if (playerInput.Spider())
{
if(skeletonMecanim.skeletonDataAsset == BigNeon)
{
skeletonMecanim.skeletonDataAsset = SmallNeon;
skeletonMecanim.Initialize(true);
animator.runtimeAnimatorController = animatorControllerNeonSmall;
}
else
{
skeletonMecanim.skeletonDataAsset = BigNeon;
skeletonMecanim.Initialize(true);
animator.runtimeAnimatorController = animatorControllerNeonBig;
}
}
Any help is appreciated!