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

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

local Beam = script.Parent

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

Enabled

bool

This property specifies whether the Beam is displayed.

Code Samples

local Beam = script.Parent

Beam.Enabled = false

Texture

string

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

Code Samples

local Beam = script.Parent

Beam.Texture = "ovdrassetid://1234"

TextureLength

number

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

Code Samples

local Beam = script.Parent

Beam.TextureLength = 10

TextureSpeed

number

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

Code Samples

local Beam = script.Parent

Beam.TextureSpeed = 5

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

local Beam = script.Parent

Beam.Transparency = NumberSequence.new(0.5)

Attachment0

Attachment

This Attachment defines the Beam's start point.

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.

Code Samples

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

Beam.Attachment1 = Attachment1

StartCurve

Vector3

This property specifies the curvature of the Beam's starting section from Attachment0 to Attachment1.

Code Samples

local Beam = script.Parent

Beam.StartCurve = Vector3.new(0, 0, 2)

EndCurve

Vector3

This property specifies the curvature of the Beam's ending section from Attachment0 to Attachment1.

Code Samples

local Beam = script.Parent

Beam.EndCurve = Vector3.new(0, 0, -2)

Segments

number

Determines how many line segments are used to render the beam curve. Higher values produce a smoother curve at the cost of performance.

Code Samples

Width0

number

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

Code Samples

local Beam = script.Parent

Beam.Width0 = 10

Width1

number

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

Code Samples

local Beam = script.Parent

Beam.Width1 = 10

FacingVector

Vector3

This property specifies the direction the Beam faces.

Code Samples

local Beam = script.Parent

Beam.FacingVector = Vector3.new(1, 1, 0)

Methods

Events

See also

VFX

Last updated