compositeOperation
The composite operation to be used by a CompositeCollider2D.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Property
- Namespace: UnityEngine
- Assembly: UnityEngine.Physics2DModule
public Collider2D.CompositeOperation compositeOperation { get; set; }
Remarks
A CompositeCollider2D is used when the composite operation is anything other than Collider2D.CompositeOperation.None.
When a CompositeCollider2D is used, the Collider geometry is merged together using this composite operation with any other Colliders using the same CompositeCollider2D. The composite operation order is controlled with _compositeOrder.
NOTE: When a CompositeCollider2D is used, the Editor will ignore and not show the _sharedMaterial, _isTrigger & _usedByEffector properties. The same properties on the CompositeCollider2D will be used instead. You should set these properties on the CompositeCollider2D instead. Also, this property is only available with the BoxCollider2D, PolygonCollider2D, CircleCollider2D and CapsuleCollider2D.
Additional Resources: _compositeOperation, _compositeOrder, CompositeCollider2D