Hi everyone I am watching this video on space shooter game tutorial
@ 11:00 can some one help me out understand why cant he initialize gameController from inspector. He explains it after that but I am having hard time understand that.
Hi everyone I am watching this video on space shooter game tutorial
@ 11:00 can some one help me out understand why cant he initialize gameController from inspector. He explains it after that but I am having hard time understand that.
Since no one has replied, I’ll step up.
Mr. B is trying to make two scripts have the ability to communicate with each other. The second script has a public field to the first, but can’t be used because the actual instances don’t exist until they have been instantiated in game. His point it that if you can’t create a reference to another object in editor it still can be done in runtime. Since the instantiated objects have the second script on them, the lookup has to be from the second script ranter than the first. It really doesn’t matter if john called jane or jane called john, the outcome is that they can now communicate.
Thanks I appreciate that