# RaycastParams

## Overview

RaycastParams는 Raycast 실행 시 적용될 조건과 필터를 정의하는 설정용 데이터 타입입니다. WorldRoot:Raycast를 호출할 때 사용되며, 어떤 객체를 충돌 대상에 포함하거나 제외할지, 어떤 충돌 그룹 기준으로 검사할지를 세밀하게 제어할 수 있습니다.

## Constructors

### new

새로운 RaycastParams 인스턴스를 생성합니다. 생성 시에는 초기 설정값이 포함되지 않으며, 레이캐스트에 사용할 필터, 충돌 그룹 등의 속성은 사용 목적에 맞게 개별적으로 지정해야 합니다.

#### Parameters

#### Return

| `RaycastParams` | 생성된 RaycastParams입니다. |
| --------------- | --------------------- |

#### Code Samples

```lua
local RaycastParams = RaycastParams.new()
```

## Properties

### BruteForceAllSlow

`boolean`

현재 지원되지 않습니다.

#### Code Samples

### FilterDescendantsInstances

`Array`

이 배열은 레이캐스트 수행 시 포함하거나 제외할 기준이 되는 객체들을 지정합니다. 배열에 등록된 각 객체의 모든 자식 요소들이 함께 고려되며, FilterType 설정에 따라 레이캐스트 충돌 대상에 포함되거나 무시됩니다.

#### Code Samples

```lua
local RaycastParams = RaycastParams.new()
RaycastParams.FilterDescendantsInstances =
{
    Workspace.Part1,
    Workspace.Part2
}
```

### FilterType

`Enum.RaycastFilterType`

FilterDescendantsInstances에 포함된 객체들을 레이캐스트 대상에 포함할지 또는 제외할지를 지정합니다. 선택된 RaycastFilterType 열거형 값에 따라, 해당 배열이 충돌 검사 후보를 제한하는 기준으로 적용됩니다.

#### Code Samples

```lua
local RaycastParams = RaycastParams.new()
RaycastParams.FilterType = Enum.RaycastFilterType.Exclude
```

### FindInitialOverlaps

`boolean`

레이캐스트 시작 시 이미 겹쳐 있는 오브젝트도 결과에 포함할지 여부를 설정합니다.

#### Code Samples

### IgnoreWater

`boolean`

현재 지원되지 않습니다.

#### Code Samples

### RespectCanCollide

`boolean`

현재 지원되지 않습니다.

#### Code Samples

### TraceComplex

`boolean`

복잡한 충돌 메시(Complex Collision)를 사용하여 정밀한 레이캐스트를 수행할지 여부를 설정합니다.

#### Code Samples

## Methods

### AddToFilter

지정된 인스턴스들을 FilterDescendantsInstances 목록에 추가합니다.

필터 배열을 직접 수정하는 방식보다 간단하고 효율적이며, 레이캐스트 필터 구성을 보다 안전하고 일관되게 관리할 수 있습니다. 또한 이 메서드는 필터 설정을 단계적으로 누적할 때 적합합니다.

#### Parameters

| `Value` InValue | 레이캐스트 필터에 추가할 인스턴스 또는 인스턴스 배열입니다. |
| --------------- | --------------------------------- |

#### Return

| `RaycastParams` | 필터가 갱신된 RaycastParams 객체를 반환합니다. |
| --------------- | -------------------------------- |

#### Code Samples

```lua
local RaycastParams = RaycastParams.new()
RaycastParams:AddToFilter(Workspace.Part1)
RaycastParams:AddToFilter({ Workspace.Part2, Workspace.Part3 })
```

## Events

## See also

{% content-ref url="/pages/7KwhvgGhSPjT2HIASnwp" %}
[WorldRoot](/korean/development/api-reference/classes/worldroot.md)
{% endcontent-ref %}


---

# 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/korean/development/api-reference/datatype/raycastparams.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.
