Search Unity

Cinemachine State machine "Animator is not playing an AnimatorController" warnings

Discussion in 'Cinemachine' started by Jaymzeh, Dec 12, 2017.

  1. Jaymzeh

    Jaymzeh

    Joined:
    Feb 20, 2015
    Posts:
    1
    After updating to 2017.2, my Cinemachine State Driven Cameras begin flooding the console with the warning:
    "Animator is not playing an AnimatorController
    UnityEngine.Animator:get_layerCount()"

    The warnings don't appear until after the scene is saved. Setting the project to play mode stops the warnings, but the editor will show that the scene has unsaved changes after stopping the project. But of course, if you save the scene you're back at square one.

    This also happens in my previously working state machine, and in new empty projects.

    Any help would be greatly appreciated.
     

    Attached Files:

    Whatever560 likes this.
  2. Corvwyn

    Corvwyn

    Joined:
    Nov 15, 2013
    Posts:
    114
    I have the same problem, and it would be nice to keep my console log tidy.
     
  3. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    417
    Had the same problem in Unity 2017.2 & CM v2.0 RC, Right now I'm using 2017.3.0f2 & CM v2.1 and the problem is gone. What's your CM version?
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,724
    Yes, the warning is annoying. The next release of CM will clear it up. In the meantime, you can patch it as follows:

    in CinemachineStateDrivenCamera.cs, near line 350, change this:
    Code (CSharp):
    1.             if (m_AnimatedTarget == null || !m_AnimatedTarget.gameObject.activeSelf
    2.                 || m_AnimatedTarget.runtimeAnimatorController == null
    3.                 || m_LayerIndex < 0 || m_LayerIndex >= m_AnimatedTarget.layerCount)
    4.            {
    5.  
    to this:
    Code (CSharp):
    1.             if (m_AnimatedTarget == null || !m_AnimatedTarget.gameObject.activeSelf
    2.                 || m_AnimatedTarget.runtimeAnimatorController == null
    3.                 || m_LayerIndex < 0 || !m_AnimatedTarget.hasBoundPlayables
    4.                 || m_LayerIndex >= m_AnimatedTarget.layerCount)
    5.             {
     
  5. kerbalette

    kerbalette

    Joined:
    Apr 9, 2019
    Posts:
    4
    This error is back again with 2019.2 :( It does appear to be fixed by @Gregorl post
     
    Last edited: Aug 5, 2019
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,724
    I don't think so. CM 2.3.4 has the change in it. Are you using an outdated version of CM?