Method SetCollisionFilter
SetCollisionFilter(CollisionFilter)
Sets the root collision filter. This also sets the filter of all children to the input value.
Declaration
public void SetCollisionFilter(CollisionFilter filter)
Parameters
Type | Name | Description |
---|---|---|
CollisionFilter | filter | Specifies the filter. |
Implements
SetCollisionFilter(CollisionFilter, ColliderKey, bool)
Sets collision filter of the child specified by collider key. If the provided key is empty, it will set the root filter and the filter of all children to the provided value. If the filter is invalid, it will throw an exception. If refreshCompoundFilter is set to false, this function will not call RefreshCollisionFilter(), and should be used in cases of updating multiple child colliders at once, where you will need to call RefreshCollisionFilter() manually after the last child filter is updated.
Declaration
public void SetCollisionFilter(CollisionFilter filter, ColliderKey childKey, bool refreshCompoundFilter)
Parameters
Type | Name | Description |
---|---|---|
CollisionFilter | filter | Specifies the filter. |
ColliderKey | childKey | The child key. |
bool | refreshCompoundFilter | True to refresh compound filter. |
SetCollisionFilter(CollisionFilter, ColliderKey)
Sets collision filter of the child specified by collider key. If the provided key is empty, it will set the root filter and the filter of all children to the provided value. If the filter is invalid, it will throw an exception. After setting the child filter, this function will also call RefreshCollisionFilter() to update the root filter based on the new child filter value.
Declaration
public void SetCollisionFilter(CollisionFilter filter, ColliderKey colliderKey)
Parameters
Type | Name | Description |
---|---|---|
CollisionFilter | filter | Specifies the filter. |
ColliderKey | colliderKey | The collider key. |