Unity Create a Game Series (E13. random spawning)

Unity Create a Game Series (E13. random spawning)

Sebastian Lague

8 лет назад

45,221 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Nam Tran
Nam Tran - 16.07.2023 19:14

NullReferenceException: Object reference not set to an instance of an object
MapGenerator.GetRandomOpenTile () (at Assets/Scripts/Map/MapGenerator.cs:198)
Spawner+<SpawnEnemy>d__11.MoveNext () (at Assets/Scripts/Spawner.cs:44)

Fix: call Generate Map in Awake method class Spawner
private void Awake()
{
map = FindObjectOfType<MapGenerator>();
map.GenerateMap();
}

Ответить
KMJ8 FL
KMJ8 FL - 31.05.2023 12:14

Thank you! 감사합니다!

Ответить
주성 변
주성 변 - 18.12.2021 17:35

21학번 김경민 잘생겼다!

Ответить
Parth Harmalkar
Parth Harmalkar - 01.10.2020 18:55

An anyone please help :
after i click play it is showing this...

after clicking it it takes to this line : Coord randomCoord = shuffledTileCoords.Dequeue ();

NullReferenceException: Object reference not set to an instance of an object
MapGenerator.GetRandomOpenTile () (at Assets/Scripts/MapGenerator.cs:221)
Spwaner+<SpwanEnemy>c__Iterator0.MoveNext () (at Assets/Scripts/Spwaner.cs:73)
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
Spwaner:Update() (at Assets/Scripts/Spwaner.cs:62)

Ответить
Hafiz Muhammad Fadli
Hafiz Muhammad Fadli - 02.09.2020 15:52

why my openTiles color doesnt change ?

Ответить
Taaamas
Taaamas - 12.08.2020 19:31

"Can only run if not disabled"
There's a joke to be made here but i can't seem to make it

Ответить
Jakob Davenport
Jakob Davenport - 07.07.2020 14:55

A very gratifying episode. Thanks again Sebastian Lague

Ответить
Deividas
Deividas - 18.02.2020 10:54

" if (player is camping) - kill camper, else act normal" lol

Truly amazing Tutorial. Thanks!

Ответить
VoodooD0g
VoodooD0g - 30.05.2018 06:55

what color scheme do you use for visual studio? would like to have that as well

Ответить
Dan
Dan - 22.12.2017 01:13

It appears the code is attempting to Dequeue openShuffledTileCoords before any were Queued. Getting a null reference error in GetRandomOpenTile. Has anyone experienced this issue?

Ответить
Harri Morgan
Harri Morgan - 11.11.2017 15:47

My enemies walk through my obstacles when they spawn in and idk why PLZ HELP!

Ответить
Anoop Moothedath
Anoop Moothedath - 10.06.2017 18:14

Hey Sebastian, after finishing this video, in my game enemies are not spawning....i coudnt find what the error is...can you help me here.

Ответить
ViviGhost : Bad Kali
ViviGhost : Bad Kali - 18.05.2017 22:25

My enemies wont spawn on diffrent locations

Ответить
Big Bunda
Big Bunda - 23.03.2017 20:44

Getting this error:
Assets/Scripts/Spawner.cs(64,20): error CS1061: Type `MapGenerator' does not contain a definition for `GetTileFromPosition' and no extension method `GetTileFromPosition' of type `MapGenerator' could be found. Are you missing an assembly reference?

Anyway to fix this?

Ответить
A7 Edits
A7 Edits - 19.01.2017 08:37

I want my enemies to spawn at waypoints on a map without tiles. There are 4 spawn points and I don't know how to code them. Everything I have tried has failed. PLZ HELP. Any help would be greatly appreciated. Also, I would still like to use the system Sebastian is using for counting how many enemies to spawn and when to start the next wave. I just want them to spawn at waypoint locations on my map that doesn't have tiles. Thanks heaps

Ответить
뭉태
뭉태 - 26.10.2016 13:44

What version is it?

Ответить
Skyehiii
Skyehiii - 09.10.2016 21:17

when i touch an obstacle my character starts gliding and doesn't stop until i shoot how do I fix this?

Ответить