Hand-written by Joseph San Nicolas, Roblox Developer
OverlapParams
Constructors
| Name | Description |
| new() | Returns a blank OverlapParams object with default values for every property. Set its properties afterward to configure the query. |
Code Snippet
local overlapParams = OverlapParams.new()
overlapParams.ExcludeInstances = {script.Parent}
overlapParams.MaxParts = 20
local size = Vector3.new(10, 10, 10)
local parts = workspace:GetPartBoundsInBox(CFrame.new(0, 5, 0), size, overlapParams)
for _, part in parts do
print(part:GetFullName())
end
Properties
| Name | Type | Description |
| ExcludeInstances | {Instance}? | An optional array of instances whose descendants will be excluded from the query. Can be used together with IncludeInstances for mixed filtering; if an instance matches both, the exclusion takes priority. |
| IncludeInstances | {Instance}? | An optional array of instances whose descendants will be included in the query. Setting this to nil includes everything, while setting it to an empty array ({}) includes nothing. |
| MaxParts | number | The maximum number of parts to be returned by the query. The default value of zero (0) means no limit. |
| CollisionGroup | string | Specifies a collision group for the operation. Parts in collision groups set to not collide with this group are ignored. Defaults to "Default" if not set. |
| Tolerance | number | Slightly increases the volume of the boundary-querying operation, clamped between 0 and 0.05 studs. |
| RespectCanCollide | boolean | When true, makes the boundary-querying operation use an intersected part's CanCollide value in favor of its CanQuery value when determining query results. |
| BruteForceAllSlow | boolean | When true, ignores all part collision properties and performs a brute-force check on every part. Significantly hurts performance and should not be used in live experiences. |
| FilterDescendantsInstances | Array | An array of objects whose descendants are used to filter query candidates, combined with FilterType. Superseded by ExcludeInstances/IncludeInstances but still supported. |
| FilterType | Enum.RaycastFilterType | Determines whether FilterDescendantsInstances is treated as an exclude list or an include list. Superseded by ExcludeInstances/IncludeInstances but still supported. |
Methods
| Name | Parameters | Returns | Description |
| AddToFilter(instances: Instance | {Instance}) | Instances: Instance or array of Instance | Void | Adds one or more instances to FilterDescendantsInstances without needing to reassign the whole array. Superseded by ExcludeInstances/IncludeInstances. |