You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Unity 2D触发NullReferenceException错误,非代码问题求排查方案

Unity NullReferenceException 问题排查求助

NullReferenceException: Object reference not set to an instance of an object
Obstacle.OnTriggerEnter2D (UnityEngine.Collider2D collision) (at Assets/Scripts/Obstacle.cs:22)

我认为代码本身没有问题,想请教到底在哪个环节出现了失误?

相关截图:

恳请帮忙解决此问题。

内容的提问来源于stack exchange,提问作者Demhat Yoldaş

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.11 08:32:16