OverlapParams
Overview
Description
The OverlapParams class is used to configure parameters for spatial computation methods, like overlap or vicinity checking functions. It allows developers to specify filtering criteria, collision properties, and other parameters to refine the results of spatial queries.
Constructors
new
Creates a new instance of the OverlapParams class, which can be configured with the desired properties.
Code Samples
local Params = OverlapParams.new()Properties
BruteForceAllSlow
boolean Determines whether or not the overlap operation will run with a "brute force" approach, which may be significantly slower but ensures it evaluates all results.
Code Samples
local Params = OverlapParams.new()
Params.BruteForceAllSlow = trueCollisionGroup
string Filters the overlap results by the specified collision group. Only parts belonging to the given collision group will be considered in the computation.
Code Samples
local Params = OverlapParams.new()
Params.CollisionGroup = "MyCollisionGroup"FilterDescendantsInstances
array An array of instances to include or exclude during the overlap computation. These instances influence the filtering settings based on the RaycastFilterType.
Code Samples
local Params = OverlapParams.new()
Params.FilterDescendantsInstances = { Workspace.Part1, Workspace.Part2 }FilterType
Enum.RaycastFilterType Defines the filtering behavior used in combination with FilterDescendantsInstances. Valid enumeration values include Blacklist and Whitelist.
Code Samples
local Params = OverlapParams.new()
Params.FilterType = Enum.RaycastFilterType.ExcludeMaxParts
number Defines the maximum number of parts (or objects) that the overlap operation should return. Setting a limit ensures performance optimization by avoiding the return of an unnecessary large number of results.
Code Samples
local Params = OverlapParams.new()
Params.MaxParts = 50RespectCanCollide
boolean Specifies whether parts that have the CanCollide property set to false should be ignored in the overlap operation.
Code Samples
local Params = OverlapParams.new()
Params.RespectCanCollide = falseMethods
AddToFilter
Adds additional instances (or an array of instances) into the filtering list for overlap computations. The new instances are appended to the FilterDescendantsInstances.
Parameters
arrayInValue
The instance or array of instances to add to the filter.
Return
OverlapParams
Returns the modified OverlapParams object for method chaining.
Code Samples
local Params = OverlapParams.new()
Params:AddToFilter(Workspace.Part1)
Params:AddToFilter({ Workspace.Part2, Workspace.Part3 })Last updated