> For the complete documentation index, see [llms.txt](https://docs.overdare.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.overdare.com/development/api-reference/datatype/raycastresult.md).

# RaycastResult

## Overview

RaycastResult is a data type that contains result information about what target a raycast actually collided with. It is returned when a WorldRoot:Raycast call succeeds and provides various data needed for raycast result analysis, such as collision point, collided object, and surface information.

## Constructors

## Properties

### BlockingHit

`boolean`

Indicates whether the raycast hit a blocking object.

#### Code Samples

### Distance

`number`

Represents the straight-line distance from where the Raycast started to where the collision occurred.

#### 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`

Represents the target object the Raycast collided with.

#### 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`

A vector representing the direction the surface that the Raycast collided with is facing. It is based on the direction perpendicular to the plane at the collision point, and used in subsequent operations such as reflection processing, angle calculation, and surface direction detection.

#### 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`

Represents the position where the Raycast collided with the target as coordinates in world space.

#### 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/A9RxgYKTmNNgDRmjtQwe" %}
[WorldRoot](/development/api-reference/classes/worldroot.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.overdare.com/development/api-reference/datatype/raycastresult.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
