Hi everyone, there’s a small issue that has been bothering me a bit from from the previous Block Breaker section and appears now as well. in the enemySpawner script we created a public GameObject called enemyPrefab that holds the enemy’s spaceship prefab. Two code lines down the road we are creating another GameObject which is initialized with the Instantiate function, while send enemyPrefab as one of its parameters. Now my question is, isn’t that an unnecessary duplication? I mean, it causes no harm, yet why don’t we the already-declared enemyPrefab GameObject?
As a second question (not sure if it has any relation to my first), I would really appreciate a bit of clarification on the diference between GameObject, gameObject, and ‘this’ (also, whats is this Object type that Instantiate returns?). I have a small mess in my head regarding these terms as I’m not quite sure which is attached to what, when do i use each of them etc. Perhaps it could help me understand my first problem.
Thanks a lot!
