Plant Defense adding in Enemies (25th & 27th Sep)
- Ben Nichols

- Nov 4, 2020
- 1 min read
25th:
I have created two simple enemy types and have been working on an enemy spawn system, which will make enemies spawn randomly from one of the multiple spawn points. I have come across an issue with this though as because the spawn points are coping the two original enemies, once these two enemies are killed and thus disactivated this means that the spawn points would start spawning disactivated copies of these enemies.
27th:
I later fixed this issue by making both the original enemies prefabs, meaning that the game would copy the prefab instead of the game objects in the scene meaning that it wouldn’t matter if the game objects of the original enemies in the scene were active or not. Though making the ‘Enemies’ prefabs did come with some issues though, as a prefab can only call other prefabs meaning that I had to make the plant a prefab as one of the scripts in the Enemy prefab called the plant game object.



Comments