Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在研究 unity2d。我在屏幕上有一个名为“gameobject1”的游戏对象。它包含一个图像(名为“状态”)。当我在“gameobject1”上拖动一棵树时,在同一层中没有检测到碰撞。有人知道这个问题吗?
请检查以下内容。
转到 Edit/Project Settings/Physics2D 中的 Physics 设置(因为您处于 2D 模式)。检查碰撞矩阵/三角形中的一切是否完美。
在脚本中,您必须使用 OnCollisionEnter2D / OnTriggerEnter2D 方法来接收碰撞通知。
如果上述两个步骤正确,请检查您是如何创建 Unity 项目的。Tat 是 2D 模式或 3D 模式。因为对于 2D 游戏,建议在创建新项目时使用 2D 模式。