my instantiation /prefab of dan wont play death animations like orignal dan
I want to instantiate a wave of the "dan" gameobjects and have this script but the animation wont play at kill time, I used the original gameobject dan as a prefab but what am I doing wrong in this script? I want them to die and be identical to the original dan gameobject but they aren't the same exactly when they die they don't play animations as original dan and keep in mind I cloned the original dan as a prefab so they should be alike
script is below
#pragma strict
var dan: GameObject;
var spawnValues : Vector2;
var danCount : int;
var spawnWait : float;
var startWait : float;
var waveWait : float;
function Start () {
SpawnWaves ();
}
function SpawnWaves () {
yield WaitForSeconds (startWait);
while (true)
{
for ( var i : int= 0; i < danCount; i++)
{
var spawnPosition : Vector2 = new Vector2 (Random.Range (0, Screen.width), Random.Range (0, Screen.height));
//var spawnPosition : Vector2= new Vector2 (Random.Range (-spawnValues.x, spawnValues.x), spawnValues.y);
var spawnRotation : Quaternion= Quaternion.identity;
Instantiate (dan, spawnPosition, spawnRotation);
yield WaitForSeconds (spawnWait);
}
yield WaitForSeconds (waveWait);
}
}
the original dan does work and play the death animation correctly but the clone/prefabs aren't working at all they just disappear on death
Your answer
Follow this Question
Related Questions
How to get access to the clone object? 1 Answer
Is it better to have several inactive prefabs in a scene, or one prefab that changes accordingly? 0 Answers
How can I destroy a prefab clone? 1 Answer
Firing projectile from Transform. What am I doing wrong? 1 Answer
How to access specific Gameobject clone from many ones? 1 Answer