Skip to content

Exercise 8: A beam that flares and fades

Purpose. To fire a beam between two points that swells, changes colour and fades out.

Every emitter so far began as a Part. Other things can be transformed too, and the procedure does not change: build one, transform it, say when, say how it looks, fire. This exercise transforms a Beam. A Beam does not travel, so it has no Motion section. In its place it has two things a Part does not: a width at each end, and a look that is set along its length.

Build an ordinary Beam, as for any Roblox Beam:

  • Two Parts a few studs apart, each holding one Attachment.
  • One Beam inside either Part, with its Attachment0 and Attachment1 set to the two Attachments, and Width0 and Width1 set to 1.

The Beam shows as a plain band between the two Parts.

Steps 1 and 2 repeat earlier exercises.

StepControlActionResult
1The BeamSelect, then press TransformThe band disappears. The Properties panel shows the Beam’s sections: Emission, Appearance, Blender, Shape, Texture.
2HUD ▸ Emit buttonPressThe band appears for one second and vanishes. The Emit box already reads 1.
3Properties ▸ Shape ▸ Width0 ▸ ⋯PressThe graph editor opens with a level line at 1.
4Graph editor ▸ Presets ▸ the fourth thumbnail, BellClick, then press ApplyA message reads Applied: Bell. The line now rises and falls back.
5Properties ▸ Shape ▸ Width0 ▸ ⋯Hold Shift and click. In the small menu, click Copy graph.Nothing visible.
6Properties ▸ Shape ▸ Width1 ▸ ⋯Hold Shift and click. In the small menu, click Paste graph.Width1 now holds the same graph.
7HUD ▸ Emit buttonPressThe beam opens from nothing to full width and closes again, over one second.
8Properties ▸ BlenderExpandOne block shows, titled State 1.
9Properties ▸ Blender ▸ + Add StatePressA second block appears, titled State 2, with Time 1. It has the same colour as State 1.
10Blender ▸ State 2 ▸ Color boxEnter 255, 60, 30No change yet.
11Blender ▸ State 2 ▸ Transparency boxEnter 1No change yet.
12HUD ▸ Emit buttonPressThe beam opens in its first colour, turns red as it closes, and fades to nothing.

Transform read the Beam as it stood. Its widths became the Width0 and Width1 graphs. Its colour and transparency became State 1 of the Blender. Its two Attachments were kept, and every beam the emitter fires is drawn between them. A Beam emitter starts with an Emit count of 1, which is why the button worked at step 2.

A preset replaces a graph with a ready shape. Bell rises and falls. The shape is fitted between the lowest and highest values the editor is showing, here 0 and 1.

Shift and ⋯ opens a small menu: Copy graph, Paste graph and Reset default. It carries a graph from one row to another on the same emitter. The copy is forgotten when the selection changes.

The Blender changes the look of the beam over its life. A beam’s colour and transparency are not single values. Each is a gradient that runs along the beam, from one Attachment to the other. A state is one such look, placed at a Time between 0, the start of the beam’s life, and 1, its end. At a state’s Time the beam shows exactly that state. Between two states it shows a smooth blend from the one to the other.

In a stateWhat it sets
TimeWhen in the beam’s life this look is reached, from 0 to 1.
ColorThe colour along the beam. Type three numbers for one colour, or press ⋯ to draw a gradient from end to end.
TransparencyThe transparency along the beam. Type one number, or press ⋯ to draw a graph from end to end.
SymptomCauseAction
Nothing shows at step 2The Beam’s Attachment0 or Attachment1 was not set before Transform.Set them with Shape ▸ Attachment 0 and Attachment 1, using the * button on each row.
The beam narrows at one end onlyWidth1 does not hold the graph.Repeat steps 5 and 6 without changing the selection in between.
Paste graph is dimThe selection changed after the copy.Repeat step 5.
The beam looks brighter or flatter than before TransformTransform sets Light Influence to 0, so scene lighting no longer shades the beam.Enter 1 in Appearance ▸ Light Influence.
A typed Time flashes redThe Time is outside 0 to 1, or another state already has it.Enter a different Time.
ChangeResult
State 1 ▸ Transparency ▸ ⋯, a graph from 0 to 1The beam is solid at one Attachment and fades toward the other.
A third state, with State 2 moved to Time 0.3The beam reaches the second look early and spends the rest of its life changing to the third.
Emission ▸ Lifetime 0.15, HUD ▸ Emit 3A short, hard flash made of three beams at once.
Texture ▸ Tex. Speed 4 on a Beam with a textureThe texture runs along the beam four times a second.
Mode Animate, Loop onOne beam that plays its graphs and states again and again, with no stacking.
New in this exerciseTransforming a Beam. A preset. Shift and ⋯ to copy a graph. The Blender.
Done beforeTransform (Exercises 1, 4, 5 and 6). The Emit button (Exercises 3 and 6). The graph editor and Apply (Exercises 4, 5 and 6).
Carried forwardNothing. Exercise 9 uses the sparks of Exercise 3 again.