PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

Color

Beam

ColorSequence

Determines the color of the Beam.

If the Beam's Beam/Texture is set, this color will be applied to the Beam's texture. If no Beam/Texture has been set then the Beam will appear as a solid bar colored in accordance with this property.

Beams and ColorSequences

This property is a DataType/ColorSequence, allowing the color to be configured to vary across the length of the Beam. Take for example the following DataType/ColorSequence.

local colorSequence = ColorSequence.new({
	ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 0, 0)), -- red
	ColorSequenceKeypoint.new(0.5, Color3.fromRGB(0, 255, 0)), -- green
	ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 255)), -- blue
	}
)

Applying this DataType/ColorSequence to a Beam would yield the following result:

enter image description here

Note the Beam's coloration also depends on the number of Beam/Segments the Beam has. Each segment of the beam can only show a transition between two colors. Therefore a Beam will need to have at least n-1 segments in order for the color to display correctly, where n is the number of DataType/ColorSequenceKeypoints in the DataType/ColorSequence


Code Samples


Creating a Beam From Scratch

​This code sample demonstrates how a Beam effect can be created from scratch by creating a Beam, setting all of its properties and configuring it’s Attachments. See below for an image of the final result:

enter image description here