Skip to content

Exercise 4: A flame that grows and fades

Purpose. To make a particle change during its life: grow, fade, and shift colour.

Every value entered so far has stayed the same from the moment a particle was made until it vanished. A flame does not work that way. Each puff starts small and bright, swells, darkens, and thins out to nothing. A value that changes over a particle’s life is drawn as a graph.

  • The workspace holds one new Part with Shape Ball, Size 1, 1, 1 and Material Neon. Set these in Studio’s own Properties window.
  • Auto-emit from Exercise 3 is off.

Steps 1 to 4 repeat what Exercises 1 and 2 taught. The new work starts at step 5.

StepControlActionResult
1The PartSelect, then press TransformThe Part turns invisible. The HUD and the Properties panel open.
2Properties ▸ Motion ▸ SpeedEnter 6No change yet. Nothing is being emitted.
3Properties ▸ Motion ▸ SpreadAngleEnter 10No change yet.
4Properties ▸ Emission ▸ EnabledSwitch onTen balls a second rise in a narrow column and vanish after one second, all the same size and colour.
5Properties ▸ Appearance ▸ Transparency ▸ ⋯PressThe graph editor opens, titled Graph - Transparency. It shows a level line at 0 with a keypoint at each end.
6Graph editor ▸ right-hand keypointDrag up to 1The line now climbs from 0 to 1. In the viewport each ball fades as it rises.
7Graph editor ▸ ApplyPressThe editor closes. The Transparency box reads <NumberSequence>.
8Properties ▸ Appearance ▸ Size ▸ X, Y, ZClick each until all three are litThe box beside them reads 1.
9Properties ▸ Appearance ▸ Size ▸ ⋯PressThe graph editor opens, titled Graph - Size (X+Y+Z), with a level line at 1.
10Graph editor ▸ left-hand keypointDouble-click, enter 0.4 for ValueThe line starts at 0.4. Each ball is made small.
11Graph editor ▸ right-hand keypointDouble-click, enter 2.5 for ValueThe line climbs from 0.4 to 2.5. Each ball swells as it rises.
12Graph editor ▸ Env boxEnter 0.2A band appears around the line. Some balls now run larger than the line and some smaller.
13Graph editor ▸ ApplyPressThe editor closes.
14Properties ▸ Appearance ▸ Color ▸ ⋯PressThe colour editor opens, titled Color - Color. It shows a bar of one colour with a marker under each end.
15Colour editor ▸ left-hand markerClick to select, click again, enter Red 255, Green 240, Blue 170, press OKThe left end of the bar is pale yellow.
16Colour editor ▸ right-hand markerClick to select, click again, enter Red 120, Green 20, Blue 0, press OKThe bar runs from pale yellow to dark red.
17Colour editor ▸ the bar, at its middleClickA third marker appears there, already selected.
18Colour editor ▸ the new markerClick, enter Red 255, Green 120, Blue 0, press OKThe bar runs yellow, orange, dark red.
19Colour editor ▸ ApplyPressThe editor closes. Each ball starts small and pale yellow, swells through orange, and fades out dark red.
20Properties ▸ Emission ▸ EnabledSwitch offThe flame stops.

A graph is read from left to right. The left edge is the moment a particle is made. The right edge is the moment it vanishes. The height of the line at any point is the value the particle has at that age.

The left-to-right scale is a share of the particle’s life, from 0 to 1. It is not measured in seconds. The same graph therefore fits a particle that lasts half a second and one that lasts ten. The long-lived particle plays the same shape more slowly. See The 0 to 1 scale.

Transparency runs from 0, fully visible, to 1, invisible.

Size is measured in studs. It is the particle’s actual size, not a multiple of the Part’s size. Transform set the three Size graphs to the size the Part had, which is why they read 1 here. The X, Y and Z buttons choose which of the three graphs the box and the ⋯ button act on. With all three lit, one graph is written to all three, and the ball stays round.

Env gives a graph a random spread. Each particle is made a little above or below the line and stays on that side for its whole life. With a spread of 0.2, one ball may run from 0.6 to 2.7 and the next from 0.3 to 2.4. A colour graph has no spread.

Between keypoints a graph runs in a straight line. The graph editor can also bend the line smoothly. That control and the others, among them presets and copy and paste, are described in The graph editor.

SymptomCauseAction
⋯ on the Size row does nothingNone of X, Y, Z is lit.Repeat step 8.
The ball stretches into an eggOnly one or two of the Size buttons were lit at step 9.Light all three and repeat steps 9 to 13.
The end keypoints will not move sidewaysThe first and last keypoints are fixed at the start and end of life. They move up and down only.Drag up or down.
The colour picker does not open at step 15The marker was clicked once. The first click selects it.Click the selected marker again.
The drawn graph is gone and the box shows a numberA number was typed into the box.Press Ctrl+Z, or draw the graph again.
ChangeResult
Click the middle of the Transparency graph and drag the new keypoint down to 0Balls stay solid for the first half of their life and fade in the second.
Speed 4, 8Each ball takes one speed of its own between 4 and 8. Two numbers in a graph’s box give a level line with a random spread.
Lifetime 0.8, 1.6Longer-lived balls rise higher and play the same graphs more slowly.
Size with only Y lit, a line from 1 to 4Balls stretch upward into streaks.
Colour editor ▸ InvertThe gradient is reversed: dark red first, pale yellow last.
New in this exerciseGraphs. The graph editor: keypoints, Env, Apply. The X, Y and Z buttons. The colour editor.
Done beforeTransform (Exercise 1). Speed (Exercise 1). SpreadAngle (Exercise 2). Enabled (Exercises 1 and 2).
Carried forwardKeep this emitter. Exercise 10 uses it again.