gameover.blog.ir
//author:sajjad3011
Vector3 pos; void Start () { InvokeRepeating("randomEnemyGenerate", 60.0f,1.0f);//call function f1() every 1 minute } void randomEnemyGenerate(){ x = Random.Range(-25, 26); y = 0; z = Random.Range(-25, 26); pos = new Vector3(x, y, z); Instantiate(prefabEnemy, pos, prefabEnemy.rotation); }