Unable To Pause Animations

Hello, I am currently using this script:

private var enter : boolean;
var target : GameObject;

function Update ()
{
	if(enter)
	{
		target.Animator.speed = 0;
		
	}
}

function OnTriggerEnter (other : Collider)
{
	if (other.gameObject.tag == "Player") 
	{
		enter = true;
	}
}

And I am receiving this error:

NullReferenceException: Object reference not set to an instance of an object
Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.String cacheKeyName, System.Type[] cacheKeyTypes, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.Object[] args, System.String cacheKeyName, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.SetProperty (System.Object target, System.String name, System.Object value)

Now I have never tried to pause an animator before and I am using unity 5, would I need to call something along the lines of: “target.getComponent…speed = 0;”?

I figured it out, I was not using GetComponent first…
Its times like this when I feel dumb, well here is the code for anyone who sees fit to need it:

private var enter : boolean;
var target : GameObject;

function Update ()
{
	if(enter)
	{
		target.GetComponent(Animator).enabled = false;
	}
}

function OnTriggerEnter (other : Collider)
{
	if (other.gameObject.tag == "Player") 
	{
		enter = true;
	}
}

Hello I think to pause the Animator component is not possible. Like other components of GameObject you can make nameOfComponent.enable = false. The Animator component is used to assign animations to a GameObject in your scene. You can create a new state of the controller make a transition in both directions and assign the speed in the inspector to 0 and run this state in the script.You have to change the script, it seems to me that you are using the Boo language!