- Home /
Question by
KloverGames · Jan 31 at 10:30 AM ·
animationanimatoravatar
How to set animator's avatar by script?
I need to set one specific animator controller's avatar by script, anyone know how its done?
void Update()
{
Animator myAnimator = GetComponent<Animator>();
//This is done to set the proper avatar so animations will work
if(skinModel == "Cube One")
{
myAnimator.avatar ;
}
else if(skinModel == "Cube Two")
{
myAnimator.avatar ;
}
}
Comment
Best Answer
Answer by KloverGames · Mar 22 at 01:45 AM
You aren't supposed to try and change the Animator Controller's avatar by script. Each Animator component can have its own avatar, you'll just have to make a list of the Animators = Animator[]
Your answer
![](https://koobas.hobune.stream/wayback/20220613052409im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Create an Avatar (for Animator) for UI? 0 Answers
Creating Avatar 1 Answer
Applying animation to character not working 0 Answers
Creating new rigged clothing for existing character prefab 1 Answer