- Home /
There is somthing like mesh collider to 2D objects?
Hi everyone, Im making simple 2D game, I designed the "way" the player going through in the game. If the player touches the wall the game is over, so I must detect collisions.
At first I created the walls from sprites, but then I realized there is no 2D collider that suit himself to the shape of the sprit(it was to difficult to create the collider manually from a lot of smaller polygon and circle colliders), so I made all the walls that builds the "way" 3D objects(.dae files with z=0.001), and added them the mash collider which suits himself to the 3D object. I changed my player to be 3D as well so the collisions types will match. It worked, but I'm sure the same game can work by much better performance with the same resources if all the game objects were 2D.
How can it be that there is a collider that suits himself to a 3D object but there is none for 2D? Maybe I miss something?
Thanks!
Answer by GameVortex · Jan 08, 2015 at 11:23 AM
You are looking for the Polygon Collider 2D.
I tried to use it, my sprite shape is not a polygon, it has "curve" parts.
All shapes are polygons. The Polygon Collider 2D automatically matches itself to the Sprite. What specifically was it that did not match with the "curve" parts?
Answer by wastifaiq · Oct 25, 2021 at 04:25 PM
Increase the complexity of the polygon collider that should do it (KEY WORD "SHOULD")
Your answer
Follow this Question
Related Questions
Very Confused About Convex Mesh Collider Result 0 Answers
Problems with mesh collider 0 Answers
Anyway to make my object not fall through the floor without convex? 0 Answers
Correct position of overlapping meshes 0 Answers
Fist Punch Collision 0 Answers