求高手救命,吐血了!getcomponent('star').game = this, 后,运行就是提示 game undefined or null!

求高手救命,吐血了!
实在是跟官方教程对比了很久,就是一样的复制过来的。。。而且Cavas 也添加了 Game组件,组件里也把ground player star 放进去了。。。

getcomponent(‘star’).game = this, 后,运行就是提示 game undefined or null!

万不得已来求救,非常感谢,一个新手,打扰了!

NewProject.zip (1.1 MB)

这是我的程序,拜托了!

在其他帖子的回复找到了线索,是star Prefab做错了,希望后面来学习遇到这个问题的可以参考~

应该是提示 getcomponent(‘star’) 的返回值为 undefined or null ???
代码调试一下就知道了呢~