"no Animator attached to the game object" but there is

Hi,

What would be a reason why I get the error:

MissingComponentException: There is no
‘Animator’ attached to the “Character”
game object, but a script is trying to
access it.

… Even though there IS an active animator attached to it?

The problem concerns a line inside of a prefab.

I use

GameObject.Find(“Character”).transform.gameObject.GetComponent().SetTrigger(“StopCharacter”);

The GameObject.Find("Character").transform.gameObject returns the correct gameObject, but for some reason, its Animator cannot be accessed.

EDIT: the target object is not a prefab, but the script that tries to access it is attached to a prefab.

Try something like this …

var obj : GameObject;
var _animator : Animator;

function Start ()
{
     obj = GameObject.Find("Character");
     _animator = obj.GetComponent.<Animator>();
     _animator.SetTrigger("StopCharacter");
}

been there.
please check your scene has only one game object named “Character”.