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.
Before starting
Section titled “Before starting”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.
Procedure
Section titled “Procedure”Steps 1 and 2 repeat earlier exercises.
| Step | Control | Action | Result |
|---|---|---|---|
| 1 | The Beam | Select, then press Transform | The band disappears. The Properties panel shows the Beam’s sections: Emission, Appearance, Blender, Shape, Texture. |
| 2 | HUD ▸ Emit button | Press | The band appears for one second and vanishes. The Emit box already reads 1. |
| 3 | Properties ▸ Shape ▸ Width0 ▸ ⋯ | Press | The graph editor opens with a level line at 1. |
| 4 | Graph editor ▸ Presets ▸ the fourth thumbnail, Bell | Click, then press Apply | A message reads Applied: Bell. The line now rises and falls back. |
| 5 | Properties ▸ Shape ▸ Width0 ▸ ⋯ | Hold Shift and click. In the small menu, click Copy graph. | Nothing visible. |
| 6 | Properties ▸ Shape ▸ Width1 ▸ ⋯ | Hold Shift and click. In the small menu, click Paste graph. | Width1 now holds the same graph. |
| 7 | HUD ▸ Emit button | Press | The beam opens from nothing to full width and closes again, over one second. |
| 8 | Properties ▸ Blender | Expand | One block shows, titled State 1. |
| 9 | Properties ▸ Blender ▸ + Add State | Press | A second block appears, titled State 2, with Time 1. It has the same colour as State 1. |
| 10 | Blender ▸ State 2 ▸ Color box | Enter 255, 60, 30 | No change yet. |
| 11 | Blender ▸ State 2 ▸ Transparency box | Enter 1 | No change yet. |
| 12 | HUD ▸ Emit button | Press | The beam opens in its first colour, turns red as it closes, and fades to nothing. |
What the steps did
Section titled “What the steps did”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 state | What it sets |
|---|---|
| Time | When in the beam’s life this look is reached, from 0 to 1. |
| Color | The colour along the beam. Type three numbers for one colour, or press ⋯ to draw a gradient from end to end. |
| Transparency | The transparency along the beam. Type one number, or press ⋯ to draw a graph from end to end. |
If the result differs
Section titled “If the result differs”| Symptom | Cause | Action |
|---|---|---|
| Nothing shows at step 2 | The 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 only | Width1 does not hold the graph. | Repeat steps 5 and 6 without changing the selection in between. |
| Paste graph is dim | The selection changed after the copy. | Repeat step 5. |
| The beam looks brighter or flatter than before Transform | Transform sets Light Influence to 0, so scene lighting no longer shades the beam. | Enter 1 in Appearance ▸ Light Influence. |
| A typed Time flashes red | The Time is outside 0 to 1, or another state already has it. | Enter a different Time. |
Variations
Section titled “Variations”| Change | Result |
|---|---|
| State 1 ▸ Transparency ▸ ⋯, a graph from 0 to 1 | The beam is solid at one Attachment and fades toward the other. |
A third state, with State 2 moved to Time 0.3 | The beam reaches the second look early and spends the rest of its life changing to the third. |
Emission ▸ Lifetime 0.15, HUD ▸ Emit 3 | A short, hard flash made of three beams at once. |
Texture ▸ Tex. Speed 4 on a Beam with a texture | The texture runs along the beam four times a second. |
Mode Animate, Loop on | One beam that plays its graphs and states again and again, with no stacking. |
| New in this exercise | Transforming a Beam. A preset. Shift and ⋯ to copy a graph. The Blender. |
| Done before | Transform (Exercises 1, 4, 5 and 6). The Emit button (Exercises 3 and 6). The graph editor and Apply (Exercises 4, 5 and 6). |
| Carried forward | Nothing. Exercise 9 uses the sparks of Exercise 3 again. |