# RaycastResult

## Overview

RaycastResult는 레이캐스트가 실제로 어떤 대상과 충돌했는지에 대한 결과 정보를 담는 데이터 타입입니다. WorldRoot:Raycast 호출이 성공했을 때 반환되며, 충돌 지점, 충돌한 객체, 표면 정보 등 레이캐스트 결과 분석에 필요한 다양한 데이터를 제공합니다.

## Constructors

## Properties

### BlockingHit

`boolean`

레이캐스트가 충돌 차단 오브젝트에 맞았는지 여부입니다.

#### Code Samples

### Distance

`number`

Raycast가 시작된 위치로부터 충돌이 발생한 지점까지의 직선 거리를 나타냅니다.

#### Code Samples

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

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

local Result = Workspace:Raycast(Origin, Direction)
if Result then
   print("Hit distance:", Result.Distance)
end
```

### Instance

`Instance`

Raycast가 충돌한 대상 객체를 의미합니다.

#### Code Samples

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

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

local Result = Workspace:Raycast(Origin, Direction)
if Result then
   print("Hit instance:", Result.Instance.Name)
end
```

### Normal

`Vector3`

Raycast가 충돌한 표면이 바라보고 있는 방향을 나타내는 벡터입니다. 충돌 지점의 면에 수직인 방향을 기준으로 하며, 반사 처리, 각도 계산, 표면 방향 판정과 같은 후속 연산에 활용됩니다.

#### Code Samples

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

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

local Result = Workspace:Raycast(Origin, Direction)
if Result then
   print("Surface normal:", Result.Normal)
end
```

### Position

`Vector3`

Raycast가 대상과 충돌한 위치를 월드 공간 기준의 좌표로 나타냅니다.

#### Code Samples

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

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

local Result = Workspace:Raycast(Origin, Direction)
if Result then
   print("Hit position:", Result.Position)
end
```

## Methods

## 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/raycastresult.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.
