How to Spawn Enemies (Unity Tutorial | 2D Top Down Shooter)

preview_player
Показать описание
In this Unity tutorial we're going to look at how to create enemy spawn points.

These spawn points will periodically create new enemies, giving us an unlimited horde of zombies to fight.

This is the twelfth video in our series showing how to make a full top down 2D shooter game in Unity.

The playlist for this series can be found here

The project files are available to our patrons here:

Want to follow along? This project is a good starting point

The final script can be found here

Help support our work:

Follow us:

#KetraGames #LearnUnity #UnityTutorials #UnityTips
Рекомендации по теме
Комментарии
Автор

I usually struggle with unity programming tutorials but this has been amazing! thank you :)

SebastianBorysiewicz
Автор

Incredibly clear!! My script didn't allow me to add values in the inspector but I corrected it with chat gpt and it worked. I love that every move is backed up with an explanation, as a student I need to understand why I'm doing it.

billietheweirdkid
Автор

This is extremely simple to follow and understand! I didn't know it was possible to do this without Coroutine, so this made life easier lol

sonicgamer
Автор

very clean and consise! thanks for the help!

stevethepirate
Автор

Great video, and great explanation, thank you so much

kelnnermagno
Автор

so i have a spawner with a graphic and want to make it destructable treating it like an enemy

ftrwar
Автор

I dont know why but my Enemys are not spawning? It doesnt create the clones or anything, maybe it correlides with another script but to figure that out... ouf idk

tonji_
Автор

Thank you! Didn't know it's possible without using Coroutine

jacobzak
Автор

Hey for some reason when I add in the spawner it spawns a few in and then the error: ''MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object. I assign the enemy prefab to the script but then I get that error after the enemy spawns in a few times

TweetyStickFigure
Автор

I am making a 2D Rocket Shooting Game for my class project, and I have EnemySpawner that will increase the spawn every once in a while, but what I don't know how to do is to make more variants of enemy to spawn. Also I kinda want stages so like the higher stage will have more enemies and variants and then a certain stage will have miniboss and main boss.

zoterodisuke
Автор

Hello, i followed the tutorial, and i have an issue where the enemy only appear in the Scene Screen and not the Game screen, why is that?

TLDR:
The enemy spawned but they are invisible in game screen, but all of their logic is there

adriankhojason
Автор

When will you upload more parts of this series? 😢

codewithtoufeeq
Автор

Hi! I have a question, If I use a prefab from a folder outside of the scene, it does not know where the player is because the player is in the scene and in the prefab I cannot use things from the scene to be set as the player, and if I use a enemy that is in the scene, when I kill the original enemy, no more can be instantiated, what should I do?

LoganOrr_
Автор

instead of Void in method setTimeUntilSpawn()

i would do a return;
float SetTimeToSpawn()
{ }

on which:
if(isRandomRangeEnabled)
{
((random range here))
isRandomRangeEnabled = false
}
timerUntilSpawn -= Time.deltaTime;

return TimerUntilSpawn;

and then put that method inside update and do if using the method because it returns the timer. The boolean would be in inspector so i could reenable it and have multiple random ranges.
if im not mistaken these should work fine

tPlayerioT
Автор

Helpful video! I'm going to try to make my player the enemy spawner where it always spawns right outside the camera's view

qaaap
Автор

The enemys spawn but theyre like hidden in game view

oziic
Автор

thank you very much ! I tried by myself but could'nt make it work

omar-
Автор

I have made it so that the spawning is working but when they spawn they only stand still and wont move, how do i fix this?
(fixed)

MawaJawa