RaycastParams

Overview

The RaycastParams object is used to configure the behavior and filtering of raycasting functions in Lua. It allows developers to specify options such as ignoring specific objects, setting collision groups, and filtering based on custom rules.

Constructors

new

Creates a new RaycastParams object with default values.

Parameters

Return

RaycastParams

A new RaycastParams.

Code Samples

local RaycastParams = RaycastParams.new()

Properties

FilterDescendantsInstances

array

Defines a list of instances whose descendants should be ignored or included by the raycast, depending on the FilterType property.

Code Samples

FilterType

Enum.RaycastFilterType

Specifies whether the instances in FilterDescendantsInstances should be included or excluded. Valid values are Whitelist or Blacklist.

Code Samples

IgnoreWater

boolean

Currently not supported.

Code Samples

CollisionGroup

string

Specifies the collision group for the raycast. This allows filtering based on predefined collision group rules.

Code Samples

RespectCanCollide

boolean

Currently not supported.

Code Samples

BruteForceAllSlow

boolean

Currently not supported.

Code Samples

Methods

AddToFilter

Adds one or more instances to the FilterDescendantsInstances property.

Parameters

Instance|array InValue

The instance(s) to add to the filter.

Return

RaycastParams

Returns the updated RaycastParams object.

Code Samples

See also

WorldRoot

Last updated