This does not work:
function Death()
{
if (eaten < 1)
{
Destroy(this.GameObject);
}
}
Neither does this:
var clone : GameObject = this.GameObject;
function Death()
{
if (eaten < 1)
{
Destroy(clone);
}
}
These are clones created from a spawn function as follows:
function Spawn()
{
if (Spawned < MaxSpawn )
{
Instantiate(SpawnObject, Vector3(transform.position.x, transform.position.y -6, transform.position.z), transform.rotation);
Spawned ++;
}
}
What do I need to do to get this thing to starve to death??? I can clearly see that eaten = 0 in debug.