Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.
OverlapParams
The OverlapParams data type stores parameters for use with WorldRoot boundary-querying functions, in particular WorldRoot:GetPartBoundsInBox(), WorldRoot:GetPartBoundsInRadius() and WorldRoot:GetPartsInPart(). The ExcludeInstances and IncludeInstances properties store a set of objects and their descendants that will be excluded and included from the query. The OverlapParams.CollisionGroup property can specify a collision group for the boundary query operation.
Unlike most data types in Luau, you can change all of the members of OverlapParams without creating a new object, allowing you to reuse the same object repeatedly.
Constructors
| Name | Type / Returns | Description |
|---|---|---|
| OverlapParams.new | Returns a blank OverlapParams object. |
OverlapParams.new
Returns a blank OverlapParams object. Unlike other data type constructors, this constructor does not have any parameters, so you should set its properties appropriately.
Properties
| Name | Type / Returns | Description |
|---|---|---|
| OverlapParams.ExcludeInstances | {Instance}? | An optional array of instances whose descendants will be excluded from the query. |
| OverlapParams.IncludeInstances | {Instance}? | An optional array of instances whose descendants will be included in the query. |
| OverlapParams.MaxParts | number | The maximum amount of parts to be returned by the query. |
| OverlapParams.CollisionGroup | string | The collision group used for the operation. |
| OverlapParams.Tolerance | number | Slightly increases the volume of the boundary-querying operation. |
| OverlapParams.RespectCanCollide | bool | Determines whether the boundary-querying operation considers a part's BasePart.CanCollide property value over its BasePart.CanQuery value. |
| OverlapParams.BruteForceAllSlow | bool | When enabled, the query will ignore all part collision properties and perform a brute-force check on every part. |
| OverlapParams.FilterDescendantsInstances | Array | An array of objects whose descendants are used in filtering candidates. |
| OverlapParams.FilterType | RaycastFilterType | Determines whether the FilterDescendantsInstances array is used as an exclude or include list. |
OverlapParams.ExcludeInstances
An optional array of instances whose descendants will be excluded from the query. This property can be used simultaneously with IncludeInstances to allow for mixed filtering, for example including a large folder but excluding specific child instances. If an instance matches both an exclude and include filter, exclusions take priority over inclusions.
| Field | Value |
|---|---|
| type | {Instance}? |
OverlapParams.IncludeInstances
An optional array of instances whose descendants will be included in the query. This property can be used simultaneously with ExcludeInstances to allow for mixed filtering. If an instance matches both an exclude and include filter, exclusions take priority over inclusions.
Setting IncludeInstances to nil versus an empty array ({}) has opposite effects. IncludeInstances = nil is the most permissive filter (includes everything), whereas IncludeInstances = {} is the most restrictive filter (includes nothing).
| Field | Value |
|---|---|
| type | {Instance}? |
OverlapParams.MaxParts
The maximum amount of parts to be returned by the query. The default value of zero (0) represents no limit.
| Field | Value |
|---|---|
| type | number |
OverlapParams.CollisionGroup
Specifies a collision group for the operation. Parts in collision groups that are set to not collide with this group are ignored. If this property is omitted, the operation assumes the Default collision group.
| Field | Value |
|---|---|
| type | string |
OverlapParams.Tolerance
Slightly increases the volume of the boundary-querying operation, clamped between 0 and 0.05 studs.
| Field | Value |
|---|---|
| type | number |
OverlapParams.RespectCanCollide
This property, if true, makes the boundary-querying operation use an intersected part's BasePart.CanCollide value in favor of its BasePart.CanQuery value when determining whether that part is included in the array of spatial query results.
| Field | Value |
|---|---|
| type | bool |
OverlapParams.BruteForceAllSlow
When enabled, the query will ignore all part collision properties and perform a brute-force check on every part. This will negatively impact performance and should not be used in live experiences.
| Field | Value |
|---|---|
| type | bool |
OverlapParams.FilterDescendantsInstances
An array of objects whose descendants are used in filtering candidates. Note that this property has been superseded by ExcludeInstances and IncludeInstances which should be used for new work.
| Field | Value |
|---|---|
| type | Array |
OverlapParams.FilterType
Determines whether the FilterDescendantsInstances array is used as an exclude or include list. Note that this property has been superseded by ExcludeInstances and IncludeInstances which should be used for new work.
| Field | Value |
|---|---|
| type | RaycastFilterType |
Methods
| Name | Type / Returns | Description |
|---|---|---|
| OverlapParams:AddToFilter | () | Adds the instances provided to FilterDescendantsInstances. |
OverlapParams:AddToFilter
Adds the instances provided to FilterDescendantsInstances. Note that this property has been superseded by ExcludeInstances and IncludeInstances which should be used for new work.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| instances | Instance | Array | An instance or an array containing instances to add. |
Returns
| Type | Description |
|---|---|
| () |