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 controlPoint1 = Beam.Attachment0.WorldPosition + (Beam.Attachment0.CFrame.rightVector * Beam.CurveSize0)
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 CurveSize0,
Beam/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
- P1: CurveSize0 studs away from
Beam/Attachment0's positive X direction.
Beam/CurveSize1studs 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: