The Composite ColliderAn invisible shape that is used to handle physical collisions for an object. A collider doesn’t need to be exactly the same shape as the object’s mesh - a rough approximation is often more efficient and indistinguishable in gameplay. More info
See in Glossary 2D component is a Collider 2D that interacts with the 2D physics system. Unlike most colliders, it doesn’t have an inherent shape. Instead, it merges the shapes of any Box Collider 2D, Polygon Collider 2D, Circle Collider 2D or Capsule Collider 2D that it’s set to use. The Composite Collider 2D component uses the vertices (geometry) from any of these colliders, and merges them together into new geometry controlled by the Composite Collider 2D component itself.
| Property | Function |
|---|---|
| Material | Select the Physics Material 2DUse this to adjust the friction and bounce that occurs between 2D physics objects when they collide More info See in Glossary that determines properties of collisionsA collision occurs when the physics engine detects that the colliders of two GameObjects make contact or overlap, when at least one has a Rigidbody component and is in motion. More info See in Glossary, such as friction and bounce. |
| Is Trigger | Enable this if you want the collider to behave as a trigger. The physics system ignores the collider when you enable this option. |
| Used By Effector | Enable this if you want an attached Effector 2D component to use the collider. |
| Offset | Set the local offset values of the collider geometry. |
| Geometry Type | Select the type of geometry to merge the vertices of the selected colliders into. Select either Outlines or Polygons from the dropdown menu. |
| Outlines | Select this to produce a collider with hollow outlines, identical to an Edge Collider 2D. |
| Polygons | Select this to produce a collider with solid polygons, identical to a Polygon Collider 2D. |
| Use Delaunay MeshThe main graphics primitive of Unity. Meshes make up a large part of your 3D worlds. Unity supports triangulated or Quadrangulated polygon meshes. Nurbs, Nurms, Subdiv surfaces must be converted to polygons. More info See in Glossary |
Enables Unity using a Delaunay triangulation algorithm to generate the collision shapes. Enabling this property can improve collision shapes for complex shapes, but can reduce performance. |
| Generation Type | Select the geometry generation method used when either the Composite Collider 2D component changes, or when any of the colliders composing it change. |
| Synchronous | Select this to have Unity immediately generate new geometry when making a change to the Composite Collider 2D component or to any of the colliders composing it. |
| Manual | Select this to have Unity generate geometry only when you request it. To request generation, either call the CompositeCollider2D.GenerateGeometry scripting API, or select Regenerate Geometry in the InspectorA Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. More info See in Glossary window. |
| Vertex Distance | Set a value for the minimum spacing allowed for any vertices gathered from the combined colliders. Unity removes any vertex closer than this limit. This allows control over the effective resolution of the vertex compositing. |
| Offset Distance | Set the value to offset vertices when compositing multiple physics shapes. Unity combines any vertices between physics shapes within this distance value. Note: It’s recommended to not set this value higher than 1% of the SpriteA 2D graphic objects. If you are used to working in 3D, Sprites are essentially just standard textures but there are special techniques for combining and managing sprite textures for efficiency and convenience during development. More info See in Glossary’s length, as this can result in loss of detail when too many vertices combine together. |
| Layer Overrides | Expand for the layer override settings. |
| Layer Override Priority | Sets the decision priority when this collision shape collides with another collision shape. Refer to its API documentation for more information. |
| Include Layers | Sets the layers this collision shape collides with. Refer to Collider2D-includeLayers. |
| Exclude Layers | Sets the layers this collision shape doesn’t collide with. Refer to Collider2D-excludeLayers. |
| Force Send Layers | Sets the layers this collision shape sends forces to during collisions. Refer to Collider2D-forceSendLayers. |
| Force Receive Layers | Sets the layers this collision shape can receive forces from during collisions. Refer to Collider2D-forceReceiveLayers. |
| Contact Capture Layers | Sets the layers of other Collider 2D components to capture during collisions. Refer to Collider2D-contactCaptureLayers. |
| Callback Layers | Sets the layers to report collisions or triggers with. Refer to Collider2D-callbackLayers. |
CompositeCollider2D