# How To Solve This Collider ?

I have a sprite spider. I want to add spider a collider which will cover its around almost perfectly. But when i add it a polygon collider, its collider becomes like the way in screenshot. I tried to solve it by vertex by but it doesn’t seem a good way to me. Do you have any ideas to cover it with a collider ?

Can i fix it by those settings ?

You can edit the polygon collider by clicking “Edit Collider” button on the collider component.

However, such a complicated concave collider will not have good performance. Does the collider really need to be perfectly aligned with the sprite for your gameplay? Often a simpler collider will behave just as well without sacrificing so much performance.

I wish, we would have different type of colliders to solve this kinda problems. Triangle collider might help me…

Why doesn’t Unity allow us to add vertices or change vertices of current colliders like box, circle, etc…? If we could, it would be easier to implement the collider shapes that we need…

The colliders you mentioned (box, circle) have extremely simple and extremely fast collision detection. If you were allowed to change vertices that would no longer be the case.

Think about a circle collider for example. Rather than looking at any vertices or anything, the collision detection is as simple as “is the distance to the center of the circle less than the circle radius”. That’s really fast and easy to calculate. For boxes you just need to check if the individual x y z Coordinates are within a certain range. Again very fast.

Once you start adding arbitrary points to the mesh and you need to do some complicated algorithm to check collision, suddenly performance drops enormously.

1 Like

@PraetorBlue thanks for your attention about the topic. I hope unity brings this feature soon. So we can decide what we want to do. I am going to add edge collider for each legs of spider and use composite collider to merge them all. So would that cost less performance drops ? I don’t think so…

Thats how to fix it by edge collider.