# Instance does not play the animation

**URL:** <https://discussions.unity.com/t/instance-does-not-play-the-animation/61261>\
**Category:** Questions & Answers\
**Created:** [January 23, 2013, 11:05am UTC](https://discussions.unity.com/t/instance-does-not-play-the-animation/61261 "2013-01-23T11:05:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Great\_Alexander](https://avatars.discourse-cdn.com/v4/letter/g/e36b37/32.png) [@Great\_Alexander](https://discussions.unity.com/u/Great_Alexander)\
**Post date:** [January 23, 2013, 11:05am UTC](https://discussions.unity.com/t/instance-does-not-play-the-animation/61261/1 "2013-01-23T11:05:35Z")

</div>

I make an instance of a skeleton and I passed the refrence of it as a public gameobject,  
but when I play animation for the skeleton nothing happen to it

Here`s my code:

```
using UnityEngine;
using System.Collections;

public class Game : MonoBehaviour {
	
	Enemy enemy;
	Player player;
	
	public GameObject _Spartan;
	public GameObject _Skeleton;
	
void Start()
	{
		player =(Player) _Spartan.AddComponent ("Player");
Vector3 vec;
		vec.x = 91;
		vec.y= 9.8f;
		vec.z = 157.8f;
		
		Instantiate (_Skeleton,vec,_Skeleton.transform.rotation );
	}
	
	void Update()
	{
player.Move ();
			
			
			if(Input.GetKeyUp("space"))
			{

animation.Play ("attack");
				_Skeleton.animation.Play ("die");
			}
}
	
	

}

```

---

<div class="post-metadata">

**Author:** ![Berenger](https://avatars.discourse-cdn.com/v4/letter/b/3da27b/32.png) [@Berenger](https://discussions.unity.com/u/Berenger)\
**Post date:** [January 23, 2013, 11:12am UTC](https://discussions.unity.com/t/instance-does-not-play-the-animation/61261/2 "2013-01-23T11:12:34Z")

</div>

\_Skeleton is your prefab, not the instance. You’re calling a function on an asset, that won’t do anything.

```
GameObject skelInstance = Instantiate (_Skeleton,vec ... ) as GameObject;
// ...
skelInstance.animation.Play ("die");

```
