NullReferenceException: Object reference not set to an instance of an object Xiaoxiong.Start () (at Assets/Script/Enemy/Xiaoxiong.cs:34)
时间: 2023-11-05 20:20:55 浏览: 109
未将对象引用设置到对象的实例 (System.NullReferenceException)
5星 · 资源好评率100%
这个错误是"NullReferenceException: Object reference not set to an instance of an object",它通常表示在代码中引用了一个空对象。在这个特定的例子中,错误发生在Xiaoxiong.cs脚本的第34行的Start()方法中。根据引用,这种错误可能是因为脚本没有被挂载到Hierarchy面板上的任何GameObject上导致的。这意味着在代码中引用的某个对象可能没有被正确初始化或赋值。在这种情况下,可以检查一下是否正确挂载了脚本,或者是否需要在脚本中进行其他初始化操作。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [【Unity】出现NullReferenceException:Object reference not set to an instance of an object.的原因总结](https://blog.csdn.net/qq_41084756/article/details/126648829)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [未将对象引用设置到对象的实例 (System.NullReferenceException)](https://download.csdn.net/download/weixin_38661800/13063655)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文