I am making a very simple game with C# but I am using JavaScript for spawning. They respawn fine but the cloned enemies can’t attack me and I can’t attack them. The scripts I have don’t transfer to the spawned enemies. (The game is based off the BergZerg Arcade one but I got bored after the second vid so I did my own thing)
Here is my script for spawning:
#pragma strict
var SpawnCubie : GameObject;
var SpawnPoint : GameObject;
var SpawnCounter : int = 0;
var SpawnCounterMax : int = 0;
function Update ()
{
this.SpawnCounter++;
if ( this.SpawnCounter >= this.SpawnCounterMax )
{
Instantiate(this.SpawnCubie, this.SpawnPoint.transform.position, this.SpawnPoint.transform.rotation);
this.SpawnCounter = 0;
}
}