GaMerijn2 / SD2TowerDefence

Tower Def
0 stars 0 forks source link

Towers not targeting Enemy's #1

Open GaMerijn2 opened 1 year ago

GaMerijn2 commented 1 year ago

My code is trying to add a gameobject to a array, but its adding "null" to a list, this causes the problem that the tower wont detect the enemy in any way.

image

GaMerijn2 commented 1 year ago

The way to solve this is to check if the Enemy prefab has the "Enemy" script assigned to it, because it finds gameobjects with the "Enemy script".