Determines, along with
Beam/Attachment0 the position of the first control point in the Beam’s Bézier curve.
The position of this point can be determined by the following equation:
local controlPoint2 = Beam.Attachment1.WorldPosition - (Beam.Attachment1.CFrame.rightVector * Beam.CurveSize1)
Beams are configured to use a cubic Bézier curve. This means they are not constrained to straight lines, and the curve of the beam can be modified by changing
Beam/CurveSize0, CurveSize1 and the orientation of the beam’s
Cubic Bézier curves are formed of four control points. They are determined as follows:
- P0: The start of the beam, the position of
Beam/CurveSize0studs away from
Beam/Attachment0’s positive X direction.
- P2: CurveSize1 studs away from
Beam/Attachment1’s negative X direction.
- P3: The end of the beam, the position of
The beam starts at P0, goes towards P1, and arrives at P3, from the direction of P2. The beam will not necessarily pass through P1 and P2.
See the images below for a visual demonstration.
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: