I'm making a grid for a tower defense game and I keep getting these errors. Does anyone know why?
7 Replies
You've named your dictionary
gameObjects
and you've also named your second parameter in your Add method, which is of type GameObject, gameObjects
So when you reference gameObjects
inside your Add method, it's referring to the GameObject
parameter, rather than your dictionarySo should I cahnge one of them to a different name?
Yes, best to name things differently to avoid confusion like this
Got it thank you
@SinFluxx Sorry to @ you again but do know why my grids is not doing what it's needed on line 28
Does your
Grids
class have a WorldToGrid
method?Oh, so while watching a class video. I just realized I had to put that in the my grid code on my own