// Use this for initialization void Start() { //Get the starting position of the enemy startPos = gameObject.transform.position; //Grab the spawner and get its script component obj = GameObject.Find("VisionLessPatrolEnemySpawner").GetComponent<VisionLessPatrollingMonsterSpawner> (); //If the spawner is facing left... if (!obj.facingRight) { //then flip the monsters it spawns to go left FlipEnemy (); } }
// Use this for initialization void Start() { //Get the starting position of the enemy startPos = gameObject.transform.position; //Grab the spawner and get its script component obj = GameObject.Find("VisionLessPatrolEnemySpawner").GetComponent <VisionLessPatrollingMonsterSpawner> (); //If the spawner is facing left... if (!obj.facingRight) { //then flip the monsters it spawns to go left FlipEnemy(); } }