Type of collider to use for the scene objects

In the lecture you never covered what collider you were using for the other scene objects, like the trees and rocks, so I started playing around with the different 2D colliders.

The Square, Circle, and Capsule for the different objects would put too much blank space around most of them and I didn’t want to do the work that a Custom collider requires.

I found that Polygon collider does a very good job of automatically conforming to the shape of all the sprites. For the cars you even get a small bump where the sideview mirrors are located.

Is there any reason, like high overhead for computation, that you shouldn’t use Polygon colliders?

Hi,

Generally, we can say: The simplest shapes are the most performant shapes. However, we will have to find a good balance between performance and “believable” behaviour. If the box collider does not work well for your game object, use a different collider such as a poligon collider. That’s fine. You have to test the different colliders to find the “best” one for your case.

Did this help?


See also:

1 Like

That is what I expected. Thanks for confirming.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms