::Hi Nathan,
I haven’t looked at the spawning system yet since taking over the project, so I’m not very clear on how the spawn system works at the moment. Once I’m done with the enemy spawning system, I will be taking a closer look at the spawn system.
That being said, let’s see if fixing the null reference exception in your code fixes all your issues. I think the issue might be to do with your chunk prefabs. Can you check to see if all your chunks have a trigger with the ChunkTrigger
script attached, and a collider on the Chunk Trigger that is sized like this?
View post on imgur.com
The issue you are having is that CheckAndSpawnChunk()
is calling when you are outside the ChunkTrigger, and when that is happening, it means that currentChunk
will be null.