[SOLVED] Enemies doesn't appear on scene

Enemies (clones) are creating on the hiearchy but doesn’t appear on game scene. Pls help me. Thank you.

SOLUTION: I found my mistake. I gone Hiearchy / Position under the EnemyFormatin and Resetted Transform under Inspector then i create formation again.

Version: Unity 4.6

EnemySpawner.cs at below

using UnityEngine;
using System.Collections;

public class EnemySpawner : MonoBehaviour {

public GameObject enemyPrefab;

void Start () {
	foreach(Transform child in transform){
		GameObject enemy = Instantiate(enemyPrefab, child.transform.position, Quaternion.identity) as GameObject;
		enemy.transform.parent = child;
	}
}

}

Position.cs below

using UnityEngine;
using System.Collections;

public class Position : MonoBehaviour {

void OnDrawGizmos() {
	Gizmos.DrawWireSphere(transform.position,1); // Position objesii için 1 yarıçapında küre gizmo oluşturur.
}

}

Just a quick clarification of the solution:
Your EnemyFormation is probably moved in the Z axis. Just move it to 0 position any you will be fine.

1 Like

Privacy & Terms