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

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

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

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

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

Enabled

bool

This property specifies whether the Beam is displayed.

Code Samples

FaceCamera

bool

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

Texture

string

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

Code Samples

TextureLength

number

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

Code Samples

TextureSpeed

number

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

Code Samples

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

Width0

number

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

Code Samples

Width1

number

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

Code Samples

Methods

Events

See also

VFXchevron-right

Last updated