Just a small tip I’d like to leave here: I haven’t seen the rest of the course yet, but it is usually simpler and less error-prone to use a specific script when referencing the Prefab instead of the Transform - in this case it would be GridDebugObject
The main advantage is that you can only assign prefabs containing the component to that field. So you won’t get an issue when trying to get it later. And in GridSystem.cs, you could have
public void CreateDebugObjects(GridDebugObject debugPrefab)
When you instantiate the debugPrefab, you no longer need to get the component. If you need the transform you can always do gridDebugObject.transform
Not sure if this has any drawbacks though, so please reply if you know of any. Thanks!
It’s a good tip, but it also depends on the use case. If you want the transform, you’d reference the transform. But what if I want, say, the player controller and the health from the same object. I can make two fields - one referencing player controller and one referencing the health - or I could just reference the transform/game object and get both from there.