OverlapParams

Overview

OverlapParams is a configuration object that manages the conditions needed when exploring part regions within the world.

Region exploration functions provided by WorldRoot reference this object to include or exclude specific objects through FilterDescendantsInstances and FilterType, and perform collision group-based exploration according to CollisionGroup settings.

Additionally, this data type allows changing configuration values without creating new objects, enabling reuse of a single OverlapParams repeatedly.

Constructors

new

Creates a new OverlapParams instance. No initial configuration values are included at creation, and properties must be specified individually according to the intended use.

Code Samples

local Params = OverlapParams.new()

Properties

BruteForceAllSlow

boolean

When enabled, this option directly checks all parts in the world, ignoring part collision settings. This has very high computational cost and can cause performance degradation, so it should only be used for testing purposes.

Code Samples

CollisionGroup

string

Defines which collision group rules the exploration operation will operate based on. Specified collision groups and parts that are mutual collision is not allowed are automatically excluded from exploration targets. If not configured separately, the default collision group is used to process the exploration.

Code Samples

FilterDescendantsInstances

array

This array specifies the reference objects to be included or excluded when performing exploration. All child elements of each object registered in the array are considered together, and depending on the FilterType setting, they are either included in or ignored as exploration targets.

Code Samples

FilterType

Enum.RaycastFilterType

Specifies whether objects included in FilterDescendantsInstances should be included in or excluded from exploration targets. Depending on the selected RaycastFilterType enum value, the array is applied as a criterion to limit exploration check candidates.

Code Samples

MaxParts

number

Used to limit the number of parts that can be returned during region exploration.

When set to 0, all results are returned without count limitation.

Code Samples

RespectCanCollide

boolean

When enabled, this option prioritizes the CanCollide property over CanQuery to determine whether parts should be checked during region exploration, providing results focused on potential collision.

Code Samples

Methods

AddToFilter

Adds the specified instances to the FilterDescendantsInstances list.

This is simpler and more efficient than directly modifying the filter array, allowing safer and more consistent management of exploration filter configuration. This method is also suitable for incrementally accumulating filter settings.

Parameters

array InValue

The instance or array of instances to be added to the exploration filter.

Return

OverlapParams

Returns the OverlapParams object with the updated filter.

Code Samples

See also

WorldRootchevron-right

Last updated