//script will by default be disabled until the conditions are met for this code to be enabled. void Awake() { //Debug.Log("Character Died and is in ghost state"); playerSprite = gameObject.GetComponent <SpriteRenderer>(); healthScript = gameObject.GetComponent <Health_enemy>(); ghostColor = gameObject.GetComponent <SpriteRenderer>(); spawnScript = spawnObj.GetComponent <BreakerSpawner_Enemy>(); ghostTimer = 5f; }
void Awake() { spawnScript = spawnerObj.GetComponent <BreakerSpawner_Enemy>(); coolDown = 2f; }