ScriptReference/ContactFilter2D #544
Replies: 1 comment
-
|
Example usage: var filter = new ContactFilter2D().NoFilter();
// Optional filtering:
filter.SetLayerMask(1 << 2); // Used to avoid having to set .useLayerMask too.
filter.SetDepth(-1, 1); // Used to avoid having to set .useDepth, comes with additional validation.
filter.SetNormalAngle(0, 180); // Used to avoid having to set .useNormalAngle, comes with additional validation.
filter.useTriggers = false; // Disables contact results based on trigger collider involvement.
// Example query
int resultCount = Physics2D.OverlapCircle(transform.position, radius, filter, results); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
ScriptReference/ContactFilter2D
https://docs.unity3d.com/ScriptReference/ContactFilter2D.html
Beta Was this translation helpful? Give feedback.
All reactions