Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


IsFilteringDepth(GameObject)

Checks if the Transform for obj is within the depth range to be filtered.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.Physics2DModule
public bool IsFilteringDepth(GameObject obj)

Parameters

The GameObject used to check the z-position (depth) of _position.

Returns

Type

Description

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

Remarks

Filtering is defined as including or excluding objects based upon a specific condition. Depth filtering checks the z-position of a GameObject_position and includes it when it is within the depth range and excludes it if otherwise. IsFilteringDepth returns true when _useDepth is set to true and the
obj
transform's z-position is outside the depth defined by _minDepth and _maxDepth. This indicates the
obj
is filtered which means it should be excluded. IsFilteringDepth returns false if otherwise. Note:: Setting _useOutsideDepth to true inverts the function behavior and it returns opposite results.
Additional Resources: _useDepth, _maxDepth