英文:
Unity mesh collider isn't colliding with other objects, 2D game
问题
我已经从Blender中的SVG创建了一个网格并将其转换为网格。然后我将其放入Unity中,以便在上面放置一个碰撞器,但是网格与任何东西都没有碰撞,即使选中了凸形。
这是我的碰撞器:
这是在Blender中的我的网格(蓝色是网格的外部):
凸形碰撞器的样子:
有人能告诉我为什么碰撞器不起作用吗?
谢谢!
英文:
I've made a mesh from an SVG in Blender and converted it to a mesh. I then put it into Unity, to put a collider on it, the mesh does not collide with anything, even with convex ticked.
Here is my collider:
And here is my mesh in Blender (blue is the outside of the mesh):
What the convex collider looks like:
Can someone tell me why the collider is not working?
Cheers!
答案1
得分: 2
MeshCollider 是在3D物理引擎中实现的,因此与2D物理引擎不兼容。它们根本不互动。
您可能想要使用的是PolygonCollider2D。
英文:
The MeshCollider is implemented in the 3D Physics engine and therefore incompatible with the 2D Physics engine. They simply don't interact.
What you probably want to use instead is the PolygonCollider2D
答案2
得分: 0
当使用碰撞器和2D时,请确保您具有以下内容:
- RigidBody2D
- Collider2D
此外,Mesh Collider 是3D 实现。如果您想要2D 中等效的 Mesh Collider,请改用 Polygon Collider 2D
。
英文:
When working with Colliders and 2D, make sure you have the following:
- RigidBody2D
- Collider2D
In addition a Mesh Collider is a 3D implementation. If you want the 2D equivalent of a Mesh Collider in 2D, use a Polygon Collider 2D
instead.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论