Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Rubenn · Sep 23, 2016 at 12:15 PM · spawnspawnpointsspawnerenemy spawnspawning-enemies

Enemy Spawn System with time and limit enemy in game

Can anyone help me with a Enemy spawning system that has time on it? I also wants to make it so that only a certain amount of enemy's will be in game, so when i kill 1 another one will spawn. No round system please. sorry for bad english

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Rubenn · Sep 25, 2016 at 08:00 PM 0
Share

i have searched for about 2 days now. cant find anyting usefull and btw most is in java. Also i cant write my own scripts because i'm new to that.

Yes I need it to spawn enemys for about every 10 second and not more than about lets say 20 in game. and only spawn to the nearest 4 spawnpoint, because i want to make a big map and if the enemys spawn at the other side of the map it will take forever to fnd them.

so if anyone can help me or find something on google please reply. maybe in return i can make some models for you

avatar image CBRZY Rubenn · Sep 25, 2016 at 08:14 PM 0
Share

In my opinion, you need to go through the tutorials that Unity has to offer. Learning to code and create games doesn't happen overnight. I studied computer science for 4 years and from the beginning of this year I have been learning Unity. Obviously the 4 years aren't necessary but it did help me start off a lot quicker.

Here is a live training session given by people working for Unity on how to start coding: https://unity3d.com/learn/tutorials/topics/scripting/coding-unity-absolute-beginner

Here is a 4 hour video on learning ALL the basics of C# with Unity: https://www.youtube.com/watch?v=7gX-$$anonymous$$26Oj1Y

Here are all the tutorials created by Unity: https://unity3d.com/learn/tutorials

Believe me, if you go through all of this you would definitely be able to make a game. You need to put in some time first before you can create a great game.

Hope this helps, and good luck.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by CBRZY · Sep 23, 2016 at 01:09 PM

Oky, there are quite a few ways of doing everything you need to be done.

I assume you want spawn an enemy every few seconds or so. You can do this by creating a Coroutine

https://docs.unity3d.com/ScriptReference/MonoBehaviour.StartCoroutine.html

 private int totalEnemies;
     void Start()
     {
          totalEnemies = 0;
          StartCoroutine(SpawnEnemy);
     }
     
     void SpawnEnemy()
     {
          while(true){
               yield return new WaitForSeconds(10);
               if (totalEnemies < 5)
               {
                    //Spawn the enemy
                    totalEnemies++;
                }
          }
     }

This will call the SpawnEnemy method every 10 seconds. It will also check the total amount of enemies currently spawned and make sure it doesn't spawn more than 5. You will just need to decrement the totalEnemies variable every time you kill an enemy.

You can also just Google for a Unity Timer. There are hundreds available.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

How to prevent multiple spawns from a single spawn point? 1 Answer

Random spawnpoint where only one prefab can spawn! 1 Answer

How to spawn enemies at different locations and avoid overlapping each other 2 Answers

SPAWNING ENEMIES and controlling the amount/interval 1 Answer

How do I add multiple different enemies to a wave spawner? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges