My animator doesn’t work: I set a bool variable from code:
animatedObject.myAnimator.SetBool("MyVariable", true);
animatedObject.SetActive(true);
But the animation isn’t triggered. I’m sure that the animator’s transition is correctly set to react with «MyVariable».
Looking at the output console, I see that I have a warning:
animator is not playing an animation controller
What does that mean?
asked Mar 9, 2018 at 21:38
![]()
Basile PerrenoudBasile Perrenoud
4,0013 gold badges29 silver badges52 bronze badges
The warning is not really helpful but what it means is that the AnimationController is disabled, or is on an inactive object. It will not be able to set variable since it currently doesn’t have a state.
Simply inverting the two lines, so that the animator is on an active object, will solve it:
animatedObject.SetActive(true);
animatedObject.myAnimator.SetBool("MyVariable", true);
answered Mar 9, 2018 at 21:38
![]()
Basile PerrenoudBasile Perrenoud
4,0013 gold badges29 silver badges52 bronze badges
The warning Animator is not playing an AnimatorController also appears, when the Animator somehow lost the reference to the Animator Controller asset.
You can see it here in screenshot, where the Animator value for Controller is «None».
Just drag in the missing Animator Controller asset from your project view.

answered Mar 9, 2018 at 23:26
|
Tezr0 0 / 0 / 0 Регистрация: 13.09.2022 Сообщений: 1 |
||||
|
1 |
||||
|
13.09.2022, 15:34. Показов 365. Ответов 1 Метки unity (Все метки)
Привет всем читающим. Я новичок в юнити. Делаю игру битва башен. Столкнулся с проблемой «animator is not playing an AnimatorController». После призыва скелета(префаб) он идёт вперёд все спокойно, он стреляет и когда враг попадает в триггер который висит на скелете он стреляет во врага, при попадании происходит эта ошибка «animator is not playing an AnimatorController». В инспекторе все указано. Скрипт скелета:
__________________
0 |
Мой аниматор не работает: я установил переменную типа bool из кода:
animatedObject.myAnimator.SetBool("MyVariable", true);
animatedObject.SetActive(true);
Но анимация не запускается. Я уверен, что переход аниматора правильно настроен на реакцию с «MyVariable».
Глядя на консоль вывода, я вижу предупреждение:
аниматор не воспроизводит контроллер анимации
Что это значит?
2 ответа
Лучший ответ
Предупреждение не очень полезно, но оно означает, что AnimationController отключен или находится на неактивном объекте. Он не сможет установить переменную, так как в настоящее время у нее нет состояния.
Простое инвертирование двух линий, чтобы аниматор находился на активном объекте, решит эту проблему:
animatedObject.SetActive(true);
animatedObject.myAnimator.SetBool("MyVariable", true);
2
Basile Perrenoud
9 Мар 2018 в 21:38
Предупреждение Animator is not playing an AnimatorController также появляется, когда Animator каким-то образом теряет ссылку на ресурс Animator Controller.
Вы можете увидеть это здесь, на снимке экрана, где значение Animator для Controller равно «None». Просто перетащите недостающий ресурс Animator Controller из представления проекта.

2
JeanLuc
9 Мар 2018 в 23:26
Unity 5.6, Spine & Spine-Unity runtime 3.6
Used SkeletonAnimator instead of SkeletonAnimation in scene, and encountered the error:
Animator is not playing an AnimatorController
UnityEngine.Animator:get_layerCount()
The controller is the default one; I didn’t change it, simply set the clips up. There’s only the base layer and no parameters used.
Hmmm…what did I do wrong? I tried google this error, but seems it’s relatively rare. 
Thanks!
5.5 years ago
- Lavennin
- Сообщения: 1
TedNindo
I am having the same warnings. A lot of them. Quite sure they are new so I am not sure why they pop up.
I am using the runtime version 3.6.x.x Since this thread is over 8 months old I think I should have the fixed version.
Animator is not playing an AnimatorController
UnityEngine.Animator:get_layerCount()
Spine.Unity.MecanimTranslator:Apply(Skeleton) (at Assets/spine-unity/SkeletonAnimator.cs:161)
Spine.Unity.SkeletonAnimator:Update() (at Assets/spine-unity/SkeletonAnimator.cs:78)
The link above is dead so I can’t fix it myself-
4.5 years ago
- TedNindo
- Сообщения: 46
Pharan
Did the warnings appear just now? What changed?
Are you using the latest? This should be included in the unitypackage by now.
Spine Unity Download
4.5 years ago
-

Pharan - Сообщения: 5366
- Сайт
TedNindo
Thanks, Pharan,
I updated once more, as it seems I did not have the very last version of the runtime libs. Seems as if the errors are gone. Thanks a lot.
4.5 years ago
- TedNindo
- Сообщения: 46
wayward_ed
I’ve just started using Spine (great software package!), and I’m seeing these same warnings with the latest unity runtime (the one dated 4/25).
Animator is not playing an AnimatorController
UnityEngine.Animator:get_layerCount(Animator)
Spine.Unity.MecanimTranslator:Apply(Skeleton) (at Assets/ImportedPackages/Spine/spine-unity/Components/SkeletonAnimator.cs:180)
Spine.Unity.SkeletonAnimator:Update() (at Assets/ImportedPackages/Spine/spine-unity/Components/SkeletonAnimator.cs:82)
They don’t happen all the time, but every now and then I’ll do something in the editor that tickles this and causes these to appear when I make any changes to the scene. If I run the game and then drop back into edit mode, they go away for a while, but they always seem to come back.
4.5 years ago
- wayward_ed
- Сообщения: 1
Dmitriy Makeyev
The guys have already passed a year, many updates have been released. Warning that was a year ago and remained.
Animator is not playing an AnimatorController
UnityEngine.Animator:get_layerCount()
Spine.Unity.MecanimTranslator:Apply(Skeleton) (at Assets/Spine/spine-unity/SkeletonAnimator.cs:139)
Spine.Unity.SkeletonAnimator:Update() (at Assets/Spine/spine-unity/SkeletonAnimator.cs:82)
Jungle Town «Birthday quest»
4 years ago
-

Dmitriy Makeyev - Сообщения: 48
Pharan
This was supposed to be already fixed in the latest version.
If you are seeing this in the latest version, do you have a repro case you can send to us?
unity@esotericsoftware.com
4 years ago
-

Pharan - Сообщения: 5366
- Сайт
dcheglakov
Dmitriy Makeyev писал(а):The guys have already passed a year, many updates have been released. Warning that was a year ago and remained.
Animator is not playing an AnimatorController
UnityEngine.Animator:get_layerCount()
Spine.Unity.MecanimTranslator:Apply(Skeleton) (at Assets/Spine/spine-unity/SkeletonAnimator.cs:139)
Spine.Unity.SkeletonAnimator:Update() (at Assets/Spine/spine-unity/SkeletonAnimator.cs:82)
Hey, try to remove Spine from Unity completely and re-import again. This helped me.
4 years ago
- dcheglakov
- Сообщения: 1
Dmitriy Makeyev
Removed, set again. At first, I was told that there were zero warnings, but then again, at once, 500 — 600 messages of the following content:
spine-unity-3_7-2019-04-27
Animator is not playing an AnimatorController
UnityEngine.Animator:get_layerCount()
Spine.Unity.MecanimTranslator:Apply(Skeleton) (at Assets/Spine/Runtime/spine-unity/Components/SkeletonMecanim.cs:222)
Spine.Unity.SkeletonMecanim:Update() (at Assets/Spine/Runtime/spine-unity/Components/SkeletonMecanim.cs:85)
Jungle Town «Birthday quest»
3.5 years ago
-

Dmitriy Makeyev - Сообщения: 48
Harald
Thanks for reporting the problem. We have just fixed the issue, it will be released together with the next unitypackages.
I will let you know as soon as it is available for download.
—
The unitypackages are now ready for download:
Spine Unity Download
3.5 years ago
-

Harald 
- Сообщения: 4451
Вернуться в Unity