# WorldRoot

WorldRoot : `Instance`

## Overview

A WorldRoot is a class used for detecting or simulating Objects in 3D space

## Properties

## Methods

### Blockcast

Moves a box-shaped region defined by a given position (CFrame) and size (Extents) into a specified Direction, detects any objects along its path, and returns the result as a RaycastResult object. It works like Raycast, but can detect a broader region of Objects as it detects collision in a box shape instead of a ray shape.

#### Parameters

| `CFrame` InCFrame               | The coordinate frame representing a box’s initial position and rotation.                                                                                                                                                               |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Vector3` InExtents             | A vector defining the size (width, length, height) of a box.                                                                                                                                                                           |
| `Vector3` InDirection           | A vector representing the box’s movement direction; its length (size) also determines the detectable distance.                                                                                                                         |
| `RaycastParams` InRaycastParams | A settings object that configures object detection conditions. Use RaycastParams to exclude specific parts or set a collision group. If not specified, the default settings apply, and all objects become potential detection targets. |

#### Return

| `RaycastResult` | A result object containing information about the first object the box collided with along its path. Returns nil if no collision occurs. |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |

#### Code Samples

### BlockcastSingleByChannel

TODO: add description.

#### Parameters

| `CFrame` InCFrame                          | TODO: add parameter description.                                                       |
| ------------------------------------------ | -------------------------------------------------------------------------------------- |
| `Vector3` InExtents                        | TODO: add parameter description.                                                       |
| `Vector3` InDirection                      | TODO: add parameter description.                                                       |
| `Enum.CollisionChannel` TraceChannel       | TODO: add parameter description.                                                       |
| `CollisionQueryParams` InQueryParams       | TODO: add parameter description. Default: `FLuaCollisionQueryParams::GetDefault()`.    |
| `CollisionResponseParams` InResponseParams | TODO: add parameter description. Default: `FLuaCollisionResponseParams::GetDefault()`. |

#### Return

| `RaycastResult` | TODO: add return description. |
| --------------- | ----------------------------- |

#### Code Samples

### BlockcastSingleByObject

Moves a box-shaped region defined by a given position (CFrame) and size (Extents) into a specified Direction, detects any objects along its path based on object query parameters, and returns the result as a RaycastResult object. It works like Blockcast, but performs collision detection based on object type.

#### Parameters

| `CFrame` InCFrame                           | The coordinate frame representing a box's initial position and rotation.                                                              |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `Vector3` InExtents                         | A vector defining the size (width, length, height) of a box.                                                                          |
| `Vector3` InDirection                       | A vector representing the box's movement direction; its length (size) also determines the detectable distance.                        |
| `CollisionQueryParams` InQueryParams        | An object that can configure detailed conditions for collision queries, including which objects to be detected or ignored.            |
| `CollisionObjectQueryParams` InObjectParams | An object specifying which object types should be detected for collisions. Allows setting specific object types as collision targets. |

#### Return

| `RaycastResult` | A result object containing information about the first object the box collided with along its path. Returns nil if no collision occurs. |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |

#### Code Samples

### BlockcastSingleByProfile

Moves a box-shaped region defined by a given position (CFrame) and size (Extents) into a specified Direction, detects any objects along its path based on the specified collision profile (ProfileName), and returns the result as a RaycastResult object. It works like Blockcast, but performs collision detection based on a collision profile.

#### Parameters

| `CFrame` InCFrame                    | The coordinate frame representing a box's initial position and rotation.                                                                                |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Vector3` InExtents                  | A vector defining the size (width, length, height) of a box.                                                                                            |
| `Vector3` InDirection                | A vector representing the box's movement direction; its length (size) also determines the detectable distance.                                          |
| `string` ProfileName                 | The name of the collision profile used for collision detection. The detection targets are determined by the collision response settings of the profile. |
| `CollisionQueryParams` InQueryParams | An object that can configure detailed conditions for collision queries, including which objects to be detected or ignored.                              |

#### Return

| `RaycastResult` | A result object containing information about the first object the box collided with along its path. Returns nil if no collision occurs. |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |

#### Code Samples

### Capsulecast

Moves a capsule-shaped region defined by a given position (CFrame), Radius, and Height into a specified Direction, detects any objects along its path, and returns the result as a RaycastResult object. Ideal for predicting character movement paths or collisions, as it detects collisions using capsule shape which resembles a character's form.

#### Parameters

| `CFrame` InCFrame               | The coordinate frame representing the initial position and rotation of a capsule.                                                                                                                                                      |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `number` InRadius               | The radius of a capsule.                                                                                                                                                                                                               |
| `number` InHeight               | The height of a capsule.                                                                                                                                                                                                               |
| `Vector3` InDirection           | A vector representing the capsule’s movement direction; its length (size) also determines the detectable distance.                                                                                                                     |
| `RaycastParams` InRaycastParams | A settings object that configures object detection conditions. Use RaycastParams to exclude specific parts or set a collision group. If not specified, the default settings apply, and all objects become potential detection targets. |

#### Return

| `RaycastResult` | A result object containing information about the first object the capsule collided with along its path. Returns nil if no collision occurs. |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |

#### Code Samples

### CapsulecastSingleByChannel

TODO: add description.

#### Parameters

| `CFrame` InCFrame                          | TODO: add parameter description.                                                       |
| ------------------------------------------ | -------------------------------------------------------------------------------------- |
| `number` InRadius                          | TODO: add parameter description.                                                       |
| `number` InHeight                          | TODO: add parameter description.                                                       |
| `Vector3` InDirection                      | TODO: add parameter description.                                                       |
| `Enum.CollisionChannel` TraceChannel       | TODO: add parameter description.                                                       |
| `CollisionQueryParams` InQueryParams       | TODO: add parameter description. Default: `FLuaCollisionQueryParams::GetDefault()`.    |
| `CollisionResponseParams` InResponseParams | TODO: add parameter description. Default: `FLuaCollisionResponseParams::GetDefault()`. |

#### Return

| `RaycastResult` | TODO: add return description. |
| --------------- | ----------------------------- |

#### Code Samples

### CapsulecastSingleByObject

Moves a capsule-shaped region defined by a given position (CFrame), Radius, and Height into a specified Direction, detects any objects along its path based on object query parameters, and returns the result as a RaycastResult object. It works like Capsulecast, but performs collision detection based on object type.

#### Parameters

| `CFrame` InCFrame                           | The coordinate frame representing the initial position and rotation of a capsule.                                                     |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `number` InRadius                           | The radius of a capsule.                                                                                                              |
| `number` InHeight                           | The height of a capsule.                                                                                                              |
| `Vector3` InDirection                       | A vector representing the capsule's movement direction; its length (size) also determines the detectable distance.                    |
| `CollisionQueryParams` InQueryParams        | An object that can configure detailed conditions for collision queries, including which objects to be detected or ignored.            |
| `CollisionObjectQueryParams` InObjectParams | An object specifying which object types should be detected for collisions. Allows setting specific object types as collision targets. |

#### Return

| `RaycastResult` | A result object containing information about the first object the capsule collided with along its path. Returns nil if no collision occurs. |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |

#### Code Samples

### CapsulecastSingleByProfile

Moves a capsule-shaped region defined by a given position (CFrame), Radius, and Height into a specified Direction, detects any objects along its path based on the specified collision profile (ProfileName), and returns the result as a RaycastResult object. It works like Capsulecast, but performs collision detection based on a collision profile.

#### Parameters

| `CFrame` InCFrame                    | The coordinate frame representing the initial position and rotation of a capsule.                                                                       |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `number` InRadius                    | The radius of a capsule.                                                                                                                                |
| `number` InHeight                    | The height of a capsule.                                                                                                                                |
| `Vector3` InDirection                | A vector representing the capsule's movement direction; its length (size) also determines the detectable distance.                                      |
| `string` ProfileName                 | The name of the collision profile used for collision detection. The detection targets are determined by the collision response settings of the profile. |
| `CollisionQueryParams` InQueryParams | An object that can configure detailed conditions for collision queries, including which objects to be detected or ignored.                              |

#### Return

| `RaycastResult` | A result object containing information about the first object the capsule collided with along its path. Returns nil if no collision occurs. |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |

#### Code Samples

### DrawRay

This method displays a ray of a specified color on the screen based on a given origin and direction for visual representation.

This is mainly used for debugging and is helpful for visually identifying the direction and destination of a Raycast.

#### Parameters

| `Vector3` InOrigin    | The starting point from which the ray is cast.                                                                                          |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `Vector3` InDirection | This vector defines the direction of the ray. The length (magnitude) of this vector also determines how far the ray can detect Objects. |
| `Color3` InColor      | The color of the ray.                                                                                                                   |
| `number` InThickness  | The width of the ray.                                                                                                                   |
| `number` InLifeTime   | The duration (in seconds) that the ray persists in the world.                                                                           |

#### Return

| `void` |   |
| ------ | - |

#### Code Samples

```lua
local Workspace = game:GetService("Workspace")

local Origin = Vector3.new(0, 50, 0)
local Direction = Vector3.new(0, 0, -1000)
local Color = Color3.fromRGB(255, 0, 0)
local Thickness = 5
local LifeTime = 1.5

Workspace:DrawRay(Origin, Direction, Color, Thickness, LifeTime)
```

### GetPartBoundsInBox

Searches for and returns an array of parts that overlap with a box-shaped region defined by a given Center and Size. Use OverlapParams to fine-tune filtering conditions and detection scope.

#### Parameters

| `CFrame` InCenter               | The center coordinate of the region to be detected.                                                                                                                                                                                    |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Vector3` InSize                | The width, height, and depth of the box-shaped detection region.                                                                                                                                                                       |
| `OverlapParams` InOverlapParams | A settings object that configures object detection conditions. Use OverlapParams to exclude specific parts or set a collision group. If not specified, the default settings apply, and all objects become potential detection targets. |

#### Return

| `Array` | An array of the objects detected within the box-shaped region. |
| ------- | -------------------------------------------------------------- |

#### Code Samples

```lua
local Center = Vector3.new(0, 50, 0)
local Size = Vector3.new(1000, 1000, 1000)
local Cframe = CFrame.new(Center)
local PartsInBox = workspace:GetPartBoundsInBox(Cframe, Size)

for _, obj in ipairs(PartsInBox) do
    print(obj.Name)
end
```

### GetPartBoundsInBoxByChannel

TODO: add description.

#### Parameters

| `CFrame` InCenter                          | TODO: add parameter description.                                                       |
| ------------------------------------------ | -------------------------------------------------------------------------------------- |
| `Vector3` InSize                           | TODO: add parameter description.                                                       |
| `Enum.CollisionChannel` TraceChannel       | TODO: add parameter description.                                                       |
| `CollisionQueryParams` InQueryParams       | TODO: add parameter description. Default: `FLuaCollisionQueryParams::GetDefault()`.    |
| `CollisionResponseParams` InResponseParams | TODO: add parameter description. Default: `FLuaCollisionResponseParams::GetDefault()`. |

#### Return

| `Array` | TODO: add return description. |
| ------- | ----------------------------- |

#### Code Samples

### GetPartBoundsInSphere

Searches for and returns an array of parts that overlap with a sphere-shaped region defined by a given Center and Radius. It is useful for proximity check or Area-of-Effect detection.

#### Parameters

| `CFrame` InCenter               | The center coordinate of the sphere-shaped region to be detected.                                                                                                                                                                      |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `number` InRadius               | The radius of a sphere.                                                                                                                                                                                                                |
| `OverlapParams` InOverlapParams | A settings object that configures object detection conditions. Use OverlapParams to exclude specific parts or set a collision group. If not specified, the default settings apply, and all objects become potential detection targets. |

#### Return

| `Array` | An array of the objects detected within the sphere-shaped region. |
| ------- | ----------------------------------------------------------------- |

#### Code Samples

### GetPartBoundsInSphereByChannel

TODO: add description.

#### Parameters

| `CFrame` InCenter                          | TODO: add parameter description.                                                       |
| ------------------------------------------ | -------------------------------------------------------------------------------------- |
| `number` InRadius                          | TODO: add parameter description.                                                       |
| `Enum.CollisionChannel` TraceChannel       | TODO: add parameter description.                                                       |
| `CollisionQueryParams` InQueryParams       | TODO: add parameter description. Default: `FLuaCollisionQueryParams::GetDefault()`.    |
| `CollisionResponseParams` InResponseParams | TODO: add parameter description. Default: `FLuaCollisionResponseParams::GetDefault()`. |

#### Return

| `Array` | TODO: add return description. |
| ------- | ----------------------------- |

#### Code Samples

### GetPartsInPart

Searches for and returns an array of all parts that overlap (collide) with a specified BasePart. Use OverlapParams to fine-tune filtering conditions, such as including or excluding specific objects.

#### Parameters

| `BasePart` InBasePart           | The part used as the reference for collision detection.                                                                                                                                                                                |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `OverlapParams` InOverlapParams | A settings object that configures object detection conditions. Use OverlapParams to exclude specific parts or set a collision group. If not specified, the default settings apply, and all objects become potential detection targets. |

#### Return

| `Array` | An array of the objects detected within the part region. |
| ------- | -------------------------------------------------------- |

#### Code Samples

### PredictProjectilePathByChannel

TODO: add description.

#### Parameters

| `Enum.CollisionChannel` InTraceChannel      | TODO: add parameter description.                                                       |
| ------------------------------------------- | -------------------------------------------------------------------------------------- |
| `PredictProjectilePathParams` PredictParams | TODO: add parameter description.                                                       |
| `CollisionResponseParams` InResponseParams  | TODO: add parameter description. Default: `FLuaCollisionResponseParams::GetDefault()`. |

#### Return

| `PredictProjectilePathResult` | TODO: add return description. |
| ----------------------------- | ----------------------------- |

#### Code Samples

### PredictProjectilePathByObject

Calculates and returns the predicted trajectory of a projectile based on object query parameters.

#### Parameters

| `PredictProjectilePathParams` PredictParams | An object containing parameters required for trajectory prediction, including the projectile's starting position, velocity, and gravity. |
| ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `CollisionObjectQueryParams` InObjectParams | An object specifying which object types should be detected for collisions. Allows setting specific object types as collision targets.    |

#### Return

| `PredictProjectilePathResult` | A result object containing information about the first object the projectile collided with along its trajectory. |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------- |

#### Code Samples

### Raycast

Casts an invisible ray based on a given origin and direction to detect objects along its path, and returns the result as a RaycastResult object. You can use a RaycastParams object to define specific targets or conditions for detection if needed. If omitted, the default settings apply, and all parts become detectable.

#### Parameters

| `Vector3` InOrigin              | The origin point from which the ray is cast.                                                                                                                                                                                           |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Vector3` InDirection           | A vector representing the ray’s direction; its length (size) also determines the detectable distance.                                                                                                                                  |
| `RaycastParams` InRaycastParams | A settings object that configures object detection conditions. Use RaycastParams to exclude specific parts or set a collision group. If not specified, the default settings apply, and all objects become potential detection targets. |

#### Return

| `RaycastResult` | A result object containing information about the first object the ray collided with along its path. Returns nil if no collision occurs. |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |

#### Code Samples

```lua
local Workspace = game:GetService("Workspace")

local Origin = Vector3.new(0, 50, 0)
local Direction = Vector3.new(0, 0, -3000)

local RaycastParams = RaycastParams.new()
RaycastParams.FilterType = Enum.RaycastFilterType.Exclude
RaycastParams.FilterDescendantsInstances =
{
    Workspace.Part
}

local Result = Workspace:Raycast(Origin, Direction, RaycastParams)
if Result then
    print("Result Position : ", Result.Position)
    print("Result Name : ", Result.Instance.Name)
else
    print("Result nil")
end
```

### RaycastMulti

Casts a ray based on a given origin and direction to detect all objects along its path, and returns the results as an array. Unlike Raycast, which returns only the first collision, it returns all collision results along the ray's path. Useful for penetration effects and multiple target detection.

#### Parameters

| `Vector3` InOrigin              | The origin point from which the ray is cast.                                                                                                                                                                                           |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Vector3` InDirection           | A vector representing the ray’s direction; its length (size) also determines the detectable distance.                                                                                                                                  |
| `RaycastParams` InRaycastParams | A settings object that configures object detection conditions. Use RaycastParams to exclude specific parts or set a collision group. If not specified, the default settings apply, and all objects become potential detection targets. |

#### Return

| `Array` | An array of all RaycastResult objects detected along a ray’s path. |
| ------- | ------------------------------------------------------------------ |

#### Code Samples

### RaycastMultiByChannel

TODO: add description.

#### Parameters

| `Vector3` InOrigin                         | TODO: add parameter description.                                                       |
| ------------------------------------------ | -------------------------------------------------------------------------------------- |
| `Vector3` InDirection                      | TODO: add parameter description.                                                       |
| `Enum.CollisionChannel` TraceChannel       | TODO: add parameter description.                                                       |
| `CollisionQueryParams` InQueryParams       | TODO: add parameter description. Default: `FLuaCollisionQueryParams::GetDefault()`.    |
| `CollisionResponseParams` InResponseParams | TODO: add parameter description. Default: `FLuaCollisionResponseParams::GetDefault()`. |

#### Return

| `Array` | TODO: add return description. |
| ------- | ----------------------------- |

#### Code Samples

### RaycastMultiByObject

Casts a ray based on object query parameters, detects all objects along its path, and returns the results as an array. It works like RaycastMulti, but performs collision detection based on object type.

#### Parameters

| `Vector3` InOrigin                          | The origin point from which the ray is cast.                                                                                          |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `Vector3` InDirection                       | A vector representing the ray’s direction; its length (size) also determines the detectable distance.                                 |
| `CollisionQueryParams` InQueryParams        | An object that can configure detailed conditions for collision queries, including which objects to be detected or ignored.            |
| `CollisionObjectQueryParams` InObjectParams | An object specifying which object types should be detected for collisions. Allows setting specific object types as collision targets. |

#### Return

| `Array` | An array of all RaycastResult objects detected along a ray’s path. |
| ------- | ------------------------------------------------------------------ |

#### Code Samples

### RaycastMultiByProfile

Casts a ray based on the specified collision profile (ProfileName), detects all objects along its path, and returns the results as an array. It works like RaycastMulti, but performs collision detection based on a collision profile.

#### Parameters

| `Vector3` InOrigin                   | The origin point from which the ray is cast.                                                                                                            |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Vector3` InDirection                | A vector representing the ray's direction; its length (size) also determines the detectable distance.                                                   |
| `string` ProfileName                 | The name of the collision profile used for collision detection. The detection targets are determined by the collision response settings of the profile. |
| `CollisionQueryParams` InQueryParams | An object that can configure detailed conditions for collision queries, including which objects to be detected or ignored.                              |

#### Return

| `Array` | An array of all RaycastResult objects detected along a ray's path. |
| ------- | ------------------------------------------------------------------ |

#### Code Samples

### RaycastSingleByChannel

TODO: add description.

#### Parameters

| `Vector3` InOrigin                         | TODO: add parameter description.                                                       |
| ------------------------------------------ | -------------------------------------------------------------------------------------- |
| `Vector3` InDirection                      | TODO: add parameter description.                                                       |
| `Enum.CollisionChannel` TraceChannel       | TODO: add parameter description.                                                       |
| `CollisionQueryParams` InQueryParams       | TODO: add parameter description. Default: `FLuaCollisionQueryParams::GetDefault()`.    |
| `CollisionResponseParams` InResponseParams | TODO: add parameter description. Default: `FLuaCollisionResponseParams::GetDefault()`. |

#### Return

| `RaycastResult` | TODO: add return description. |
| --------------- | ----------------------------- |

#### Code Samples

### RaycastSingleByObject

Casts a ray based on object query parameters, detects the first colliding object along its path, and returns a RaycastResult object. It works like Raycast, but performs collision detection based on object type.

#### Parameters

| `Vector3` InOrigin                          | The origin point from which the ray is cast.                                                                                          |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `Vector3` InDirection                       | A vector representing the ray’s direction; its length (size) also determines the detectable distance.                                 |
| `CollisionQueryParams` InQueryParams        | An object that can configure detailed conditions for collision queries, including which objects to be detected or ignored.            |
| `CollisionObjectQueryParams` InObjectParams | An object specifying which object types should be detected for collisions. Allows setting specific object types as collision targets. |

#### Return

| `RaycastResult` | A result object containing information about the first object the ray collided with along its path. Returns nil if no collision occurs. |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |

#### Code Samples

### RaycastSingleByProfile

Casts a ray based on the specified collision profile (ProfileName), detects the first colliding object along its path, and returns a RaycastResult object. It works like Raycast, but performs collision detection based on a collision profile.

#### Parameters

| `Vector3` InOrigin                   | The origin point from which the ray is cast.                                                                                                            |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Vector3` InDirection                | A vector representing the ray's direction; its length (size) also determines the detectable distance.                                                   |
| `string` ProfileName                 | The name of the collision profile used for collision detection. The detection targets are determined by the collision response settings of the profile. |
| `CollisionQueryParams` InQueryParams | An object that can configure detailed conditions for collision queries, including which objects to be detected or ignored.                              |

#### Return

| `RaycastResult` | A result object containing information about the first object the ray collided with along its path. Returns nil if no collision occurs. |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |

#### Code Samples

### Spherecast

Moves a sphere-shaped region defined by a given origin and radius into a specified direction, detects any objects along its path, and returns the result as a RaycastResult object. It works like Raycast, but can detect a broader area of Objects as it detects collision in a sphere shape instead of a ray shape. Useful for melee weapon detections and wide-area collision detections.

#### Parameters

| `Vector3` InOrigin              | The origin point of a sphere.                                                                                                                                                                                                          |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `number` InRadius               | The radius of a sphere.                                                                                                                                                                                                                |
| `Vector3` InDirection           | A vector representing the sphere’s movement direction; its length (size) also determines the detectable distance.                                                                                                                      |
| `RaycastParams` InRaycastParams | A settings object that configures object detection conditions. Use RaycastParams to exclude specific parts or set a collision group. If not specified, the default settings apply, and all objects become potential detection targets. |

#### Return

| `RaycastResult` | A result object containing information about the first object the sphere collided with along its path. Returns nil if no collision occurs. |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |

#### Code Samples

### SpherecastSingleByChannel

TODO: add description.

#### Parameters

| `CFrame` InCFrame                          | TODO: add parameter description.                                                       |
| ------------------------------------------ | -------------------------------------------------------------------------------------- |
| `number` InRadius                          | TODO: add parameter description.                                                       |
| `Vector3` InDirection                      | TODO: add parameter description.                                                       |
| `Enum.CollisionChannel` TraceChannel       | TODO: add parameter description.                                                       |
| `CollisionQueryParams` InQueryParams       | TODO: add parameter description. Default: `FLuaCollisionQueryParams::GetDefault()`.    |
| `CollisionResponseParams` InResponseParams | TODO: add parameter description. Default: `FLuaCollisionResponseParams::GetDefault()`. |

#### Return

| `RaycastResult` | TODO: add return description. |
| --------------- | ----------------------------- |

#### Code Samples

### SpherecastSingleByObject

Moves a sphere-shaped region defined by a given position (CFrame) and Radius into a specified Direction, detects any objects along its path based on object query parameters, and returns the result as a RaycastResult object. It works like Spherecast, but performs collision detection based on object type.

#### Parameters

| `CFrame` InCFrame                           | The coordinate frame representing the initial position and rotation of a sphere.                                                      |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `number` InRadius                           | The radius of a sphere.                                                                                                               |
| `Vector3` InDirection                       | A vector representing the sphere's movement direction; its length (size) also determines the detectable distance.                     |
| `CollisionQueryParams` InQueryParams        | An object that can configure detailed conditions for collision queries, including which objects to be detected or ignored.            |
| `CollisionObjectQueryParams` InObjectParams | An object specifying which object types should be detected for collisions. Allows setting specific object types as collision targets. |

#### Return

| `RaycastResult` | A result object containing information about the first object the sphere collided with along its path. Returns nil if no collision occurs. |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |

#### Code Samples

### SpherecastSingleByProfile

Moves a sphere-shaped region defined by a given position (CFrame) and Radius into a specified Direction, detects any objects along its path based on the specified collision profile (ProfileName), and returns the result as a RaycastResult object. It works like Spherecast, but performs collision detection based on a collision profile.

#### Parameters

| `CFrame` InCFrame                    | The coordinate frame representing the initial position and rotation of a sphere.                                                                        |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `number` InRadius                    | The radius of a sphere.                                                                                                                                 |
| `Vector3` InDirection                | A vector representing the sphere's movement direction; its length (size) also determines the detectable distance.                                       |
| `string` ProfileName                 | The name of the collision profile used for collision detection. The detection targets are determined by the collision response settings of the profile. |
| `CollisionQueryParams` InQueryParams | An object that can configure detailed conditions for collision queries, including which objects to be detected or ignored.                              |

#### Return

| `RaycastResult` | A result object containing information about the first object the sphere collided with along its path. Returns nil if no collision occurs. |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |

#### Code Samples

## Events


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.overdare.com/development/api-reference/classes/worldroot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
