Just for completeness (and others googling the problem):
This warning will be thrown, when the gameobject containing the animator is not active. To avoid the problem check for animator.gameObject.activeSelf. Source
I’m just having the problem that GetCurrentAnimatorStateInfo isn’t working it says GetCurrentAnimatorStateInfo(Int32) And also this appeared: SetFloat(String, Single)
Am I right in thinking that this error actually isn’t that bad for the game? I have the same thing because the GameObject containing the animator is repeatedly being activated and deactivated. But everything seems to run just fine when the the object is active and playing the animation.
It a warning to let you know that you are trying to change something but the animator cannot carry out the operation because it disabled or it not playing any animation.
You are basically doing an operation that does nothing.
So the warning isn’t that bad for a game but you are actually using cpu cycle that will give no result.
This seems to happen any time you disable a game object with an animator on it. Even if no script is doing anything and no calls to setTrigger, it happens here until i re-enable the object. Which means I cant turn off an animator or it just constantly has this warning coming up. Any solution to that ?
Sorry for the delay, though I cannot report the bug, the bug reporter has errors, it says “error occured whhile creating an archive error code file read failed”, im not attaching files.
my report would have been:
What happened
If I disable a gameobject with an Animator on it, and it is completely off with no script using it. I still get “Animator is not playing an AnimatorController” as a warning in my game (repeatedly not just once), this creates a lot of output in my console, when really there should be none, because the objects aren’t even on anymore. The reason they turn on and off in my game is that when I leave a city theyre turned off, when I come back theyre turned back on.
How we can reproduce it using the example you attached
Turn off any gameobject using an animator at run time
Animator is not playing an AnimatorController. This error pops up whenever the setTrigger is called in a script. When this error happens the bird animation still works but the background animation stops moving.
I’m still getting this warning two years later in 2021.3.21f1 when saving my scene.
I have an object with a component derived from Button and an Animator component. If I change any properties of any component on the GameObject and then save the scene, I get a burst of “Animator is not playing an AnimatorController” warnings that originate in the following line of code in Editor.OnInspectorGui() :
// Have to comment out the following test because it results in a flood of "Animator is not playing
// an AnimatorController" warnings for some bizarre reason when saving the project.
//
if( false == button.animator.parameters.Any( x => x.name == button.TransitionAnimations.NormalToSelected ) )
The GameObject is not disabled.
The Animator component is not disabled.
The Button component is not disabled.
Animator.runtimeAnimatorController is not null.
I am not attempting to play any animation or set or clear any triggers, I am simply attempting to query the parameters to see if a Trigger with a given name even exists.
I have not been able to find a workaround, other than simply not attempting to retrieve the list of parameters, which is obviously not a feasible workaround.
[EDITED TO ADD]
In my particular case, adding a check for EditorApplication.isUpdating resolved the issue during save, although I have now noticed that I still get the warning when I hit the Undo button after making any change in the scene.
But isn’t it possible to intentionally change a parameter on an inactive animator so that later when in becomes active it will have the correct parameters set ?
Sometimes the Animator can auto generate causing a lost path. This happened to me when deleting some files. I ended up with x2 Animators when only one is allowed. I deleted the auto generated Animator from Player has I had one set as a child.