Unity 5.6 / C# error CS1061

I’ve upgraded my project from Unity 4 to 5.6 and I get a bunch of errors.
One of them is on a line which was written like this in Unity 4:

//ActiveNPC is a Transform and I am deactivating it's Animator component:
ActiveNPC.GetComponent<Animator>().active=false;//this worked fine in Unity 4

and in Unity 5.6, I am using this syntax:


I am getting:
error CS1061: Type UnityEngine.Animator' does not contain a definition for SetActive’ and no extension method SetActive' of type UnityEngine.Animator’ could be found. Are you missing an assembly reference?

Any help will be greatly appreciated :slight_smile:

ok it seems enabling and disabling components is done differently now, there’s a nice youTube tutorial by Unity that explains how I should have done it:


I kept the question up for anyone else having the same problem