Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


layerMask

Sets the contact filter to filter the results that only include Collider2D on the layers defined by the layer mask.
Read time 1 minuteLast updated 6 days ago

Definition

  • Type: Field
  • Namespace: UnityEngine
  • Assembly: UnityEngine.Physics2DModule
public LayerMask layerMask

Remarks

This field takes effect if ContactFilter2D.useLayerMask is true.
Additional Resources: LayerMask.