Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


IsFilteringTrigger(Collider2D)

Checks if the collider is a trigger and should be filtered by the _useTriggers to be filtered.
Read time 1 minuteLast updated 6 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.Physics2DModule
public bool IsFilteringTrigger(Collider2D collider)

Parameters

collider

The Collider2D used to check for a trigger.

Returns

Type

Description

boolReturns true when
collider
is excluded by the filter and false if otherwise.

Remarks

Filtering is defined as including or excluding objects based upon a specific condition. Trigger filtering checks the _isTrigger and includes it if triggers are being used and excludes it otherwise. IsFilteringTriggers returns true when _useTriggers is set to false and _isTrigger is true. This indicates the
collider
is filtered which means it should be excluded. IsFilteringTriggers returns false if otherwise.
Additional Resources: _useTriggers