- Home /
The question is answered, right answer was accepted
How to create a 3d polygon collider?
In Physics2D, we can find Polygon Collider 2D, which can simply be edited by adding a vertex and just move it. It's pretty simply for 2D games to create colliders in Edit mode, or even in a level editor.
However, in Physics(3D), we can only find colliders like Box Collider or Sphere Collider, which are not designed to be edited with vertexes.
So if i want to create a 2D platform game with Z-Axis available, just like Rayman which can jump between platforms with different z-axis, it seems to be pretty hard to create colliders for the platforms.
I don't appreciate the solution of using Mesh Collider or making a Box-Collider-group. That's so ugly and hard to use.
Actually something like Polygon Collider 2D with a depth of z-axis makes more sense for me, because it's simple for the level designers to create great colliders.
Is it possible to create such a collider?
Answer by cwbeta · Apr 28, 2017 at 12:41 PM
A sufficient answer from the forum: https://forum.unity3d.com/threads/how-to-create-a-3d-polygon-collider.468087/
Answer by AdamAlexander · Apr 28, 2017 at 06:03 AM
How come you don't want to use the mesh collider? That's the 3D equivalent to the 2D polygon collider. Maybe post an image of what your thinking. You'll either need to use the mesh collider using physics 3D. Or you can have multiple layers of 2D colliders and activate/deactivate them when your character jumps between the platforms along the z axis.
I thought mesh collider would be hard for level designers to create, but I was wrong. I found a good answer from the Unity forum (https://forum.unity3d.com/threads/how-to-create-a-3d-polygon-collider.468087/) and I think I can close the question. Thank you for you reply!
Answer by tanoshimi · Apr 28, 2017 at 06:25 AM
I've never played a Rayman game, but I was always under the impression that they were 2D? If it's like LittleBigPlanet, where you can move between a foreground and background layer, you simply need two layers of polygon colliders and activate/deactivate collisions between them and the player using the layer collision matrix at runtime.
Actually my scene is a 3D level with 2D sprites and 3d ground, so I need 3D polygon colliders. I found a sufficient solution from the forum(link text) and I think I can close the question. Thank you for your reply!
the link is: (https://forum.unity3d.com/threads/how-to-create-a-3d-polygon-collider.468087/)
Follow this Question
Related Questions
Change polygon collider depending on the animation 0 Answers
How to edit PolygonCollider2D vertices IN CODE? 0 Answers
Any way to visualize Overlap methods without using Gizmos? 0 Answers
Character Controller won't collide with anything 1 Answer
Tilemap Collider 2D preventing objects from moving 2 Answers