# Beam

Beam : `Instance`

## Overview

As an instance that connects two Attachments, it automatically links the specified start and end points for effects such as lasers, electricity, or energy beams

## Properties

### Attachment0

`Attachment`

This Attachment defines the Beam's start point.

It is used as the initial reference point for constructing the beam’s curve, and the position of the next control point is calculated based on the Attachment’s rotation direction and the CurveSize0 value. This determines the beam’s curvature and overall shape.

#### Code Samples

```lua
local Beam = script.Parent
local Workspace = game:GetService("Workspace")
local Part = Workspace:WaitForChild("Part")
local Attachment0 = Part:WaitForChild("Attachment0")

Beam.Attachment0 = Attachment0
```

### Attachment1

`Attachment`

This Attachment defines the Beam's end point.

It is used as the final reference point for constructing the beam’s curve, and the position of the previous control point is calculated based on the Attachment’s rotation direction and the CurveSize1 value. This determines the beam’s curvature and overall shape.

#### Code Samples

```lua
local Beam = script.Parent
local Workspace = game:GetService("Workspace")
local Part = Workspace:WaitForChild("Part")
local Attachment1 = Part:WaitForChild("Attachment1")

Beam.Attachment1 = Attachment1
```

### Color

`ColorSequence`

A ColorSequence can be used to control the color of the Beam as it gradually changes.

If a texture is applied to the Beam, this color is overlaid on the texture.

#### Code Samples

```lua
local Beam = script.Parent

Beam.Color = ColorSequence.new(Color3.fromRGB(255, 0, 0))
```

### CurveSize0

`number`

Defines the position of the second control point of the Bézier curve that composes the beam, together with Attachment0.

This control point is a key element in shaping the beam’s curvature and flow, and the form of the Bézier curve is determined by the combination of Attachment0’s orientation and this value. Through this, the degree of bending and the visual representation of the beam can be finely adjusted.

#### Code Samples

```lua
local Beam = script.Parent

Beam.CurveSize0 = 1
```

### CurveSize1

`number`

Defines the position of the third control point of the Bézier curve that composes the beam, together with Attachment1.

This control point is a key element in shaping the beam’s curvature and flow, and the form of the Bézier curve is determined by the combination of Attachment1’s orientation and this value. Through this, the degree of bending and the visual representation of the beam can be finely adjusted.

#### Code Samples

```lua
local Beam = script.Parent

Beam.CurveSize1 = 1
```

### Enabled

`boolean`

This property specifies whether the Beam is displayed.

#### Code Samples

```lua
local Beam = script.Parent

Beam.Enabled = false
```

### FaceCamera

`boolean`

This property sets the beam to always face the camera.

Since a beam is a plane-based object that exists in three-dimensional space, it may not be visible on the screen depending on the camera’s position or angle. When the FaceCamera value is enabled, the beam automatically rotates based on the currently active camera, ensuring that it always faces forward. This allows the beam’s visibility to be maintained consistently from various viewpoints.

#### Code Samples

```lua
local Beam = script.Parent

Beam.FaceCamera = true
```

### Texture

`string`

This property specifies the texture to be displayed on the Beam.

#### Code Samples

```lua
local Beam = script.Parent

Beam.Texture = "ovdrassetid://1234"
```

### TextureLength

`number`

This property specifies the length of the texture applied to the Beam.

#### Code Samples

```lua
local Beam = script.Parent

Beam.TextureLength = 10
```

### TextureSpeed

`number`

This property specifies the speed of the texture applied to the Beam.

#### Code Samples

```lua
local Beam = script.Parent

Beam.TextureSpeed = 5
```

### Transparency

`NumberSequence`

A NumberSequence can be used to control the transparency of the Beam to change gradually when it appears and fades out.

#### Code Samples

```lua
local Beam = script.Parent

Beam.Transparency = NumberSequence.new(0.5)
```

### Width0

`number`

This property specifies the width of the Beam's starting section.

#### Code Samples

```lua
local Beam = script.Parent

Beam.Width0 = 10
```

### Width1

`number`

This property specifies the width of the Beam's ending section.

#### Code Samples

```lua
local Beam = script.Parent

Beam.Width1 = 10
```

## Methods

## Events

## See also

{% content-ref url="/pages/UHaO21fVTwrimnAJr3x3" %}
[VFX](/manual/studio-manual/object/vfx.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/development/api-reference/classes/beam.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.
