=> The next time there are 8 enemy instances.=> The next time there are 4 enemy instances including this spawner.=> The next time there are 2 enemy instances including this spawner.Instantiate(enemyPrefab, transform.position,transform.rotation) Īctually what you had should also work! Depends of course also on the values you set via the Inspector.īUT What I can see from the image you posted is: In enemy you referenced the object itself! I would rather do it using a simple timer in Update: public class EnemySpawner : MonoBehaviour but who wants to calculate how long this actually takes?īy default fixed update step is 0.02s so 100 means 2 real-time seconds - but what if you change the fixed update step for any reason? You should not as in the accepted answer use FixedUpdate for this! It uses 100 fixed update steps.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |