- Home /
Other
Trying to make a spawning enemy code
The enemy will spawn in the same spot. When the enemy spawn he wil move down towards the player if the player jumps over the enemy the enemy will keep moveing until he hit the end of the world. Once the enemy is dead the next enemy will spawn. Help please.
Answer by melkorinos · May 04, 2015 at 12:52 PM
I will answer your question in the title, however the rest of your questions are other issues, try searching for them as I am sure they have already been answered here.
To spawn an enemy, create a empty game object (which will be the spawn point and place it where you want your enemies to spawn), attach a script to it where you instantiate an object(which you will make public and through the inspector you will attach your enemy prefab). From documentation check Instantiate.
As for moving the enemy, create a enemy behavior script and use transform.Translate or some other option(rigidbody.velocity, rigidbody.addforce). If you need me to expand on anything feel free to ask away, but I encourage you to try first and ask if you get stuck again.
Follow this Question
Related Questions
How would I go about enemy spawning? (C#) 1 Answer
NavMesh Sample Position Help 1 Answer
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers