Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How to Disable Animator Via Code ?

Discussion in 'Scripting' started by Atix07, Jun 7, 2014.

  1. Atix07

    Atix07

    Joined:
    Jul 27, 2013
    Posts:
    182
    How to disable that animator with code?
     

    Attached Files:

  2. ElvisAlistar

    ElvisAlistar

    Unity Technologies

    Joined:
    Oct 2, 2013
    Posts:
    226
    You disable it the same way as you would disable any other component: call
    Code (csharp):
    1.  GetComponent<Animator>().enabled = false;
    on the GameObject that has the Animator component.
     
  3. Atix07

    Atix07

    Joined:
    Jul 27, 2013
    Posts:
    182
    Thanks for everythink! Easy and effective :) Very fast reply +