CompositeCollider2D.GeometryType.Outlines

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual

Description

Sets the Composite Collider to generate closed outlines for the merged Collider geometry consisting of only edges.

The outline geometry is equivalent to using an EdgeCollider2D with the chains of edges all connected. While all the edges are closed (the end edge connects to the start edge), nothing will collide in the interior of such geometry, that is it will not overlap. A collision or trigger will be registered only if the edges are in contact with a Collider.

This is usually the most efficient geometry to use as it produces far less edges. Continuous edges do not cause unwanted collisions because all edges are connected. Unwanted collisions is where two separate Colliders get in contact even though both are aligned perfectly. Use this type of geometry to produce platform surfaces where other Colliders are to move without any interference from unwanted collisions.

Any interior holes caused by the the composite edges surrounding it, does not cause any interior overlap but is another closed off section of the new Composite Collider shape.

对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答