Lightning
A Lightning emitter makes bolts: jagged lines of thin segments from a start point to an end point. A bolt reshapes itself many times a second. It can branch into forks, be drawn from one end to the other, taper, and leave a disk where it lands.
Exercise 12 makes a Lightning emitter for the first time.
What it makes possible:
- An arc between two props. Mode
Animate, Loop on, Target ModePoint, Target set to the other prop. One bolt stays and tracks both ends. - A strike from the sky. An emitter high up, Direction
Bottom, Growth Speed300, 800, a Taper graph from 1 to 0.2, Lifetime0.3, Fork Chance0.6, Fork Depth2. Each bolt races down at a speed of its own. - A scorch that drags across the floor. Target Mode
Seek, Retarget on, Retarget Speed40, Impact Disk on with a scorch image, On Hit firing sparks with ModeAtPosition. - A crown of bolts. Rotation Y
0, 360with its Even dot on, Dir. ModeLocal, DirectionFront, Emit8. - A ball that bristles with bolts. Use shape on, Shape
Sphere, Hollow1, Bolt DirectionRadial, Emit12, a short Length. - A slow tendril of plasma. Shape Mode
Scroll, Waves2, Scroll Speed0.5, Sag0.2, Sag Shape0.5, a Gradient from white to blue, Material Neon. - A bolt that lights the room. A Light emitter with Emit
1inside the LightningRenderTemplate.
At a glance
Section titled “At a glance”| Made from | A Part or a MeshPart, with Transform as Lightning |
| One particle is | One bolt with its forks |
| Emit count starts at | 1 |
| Modes | Emit and Animate |
| Sections | Emission, Appearance, Spawn, Motion, Bolt, Impact, Events, Advanced |
| Not present | Link. The bolt follows the emitter Part itself. |
An Emit count of 3 means three bolts, not three segments. A bolt counts as one particle toward the particle counter and the Particle Cap, however many segments it has.
A bolt is a temporary group of parts. It is not solid. Characters walk through it, and it pushes nothing.
Spawn, Motion, Impact, Events and Advanced start collapsed.
Where a bolt starts and ends
Section titled “Where a bolt starts and ends”A bolt starts at the emitter Part, moved by the rows of the Spawn section. Its end is chosen by Bolt ▸ Target Mode.
The bolt reads the emitter Part’s own position and rotation at every reshape. Move the Part, or weld it to something that moves, and the start of the bolt goes with it.
| Case | The bolt starts |
|---|---|
| The emitter stands by itself | At the emitter Part, and follows it. |
| The emitter is nested in another emitter | At the parent particle, and rides it. |
| The emitter is fired by another emitter’s event | At the spot of the event, and stays there. |
| The emitter Part is removed while a bolt is alive | At the last place the Part had. |
Transform as Lightning
Section titled “Transform as Lightning”Select a Part. Press ▾ beside Transform, then Transform as Lightning.
Any Part or MeshPart that is not yet an emitter can be used. It may hold a SpecialMesh, Decals, Textures or a SurfaceAppearance.
| Thing | After the transform |
|---|---|
| The Part | It turns fully transparent. It marks where bolts start. |
RenderTemplate | A hidden copy of the Part. Every segment of every bolt is a duplicate of it. |
| A SpecialMesh, Decal, Texture or SurfaceAppearance in the Part | It is kept in the RenderTemplate, so every segment shows it. |
| A SpecialMesh, Decal or Texture on the Part itself | It is removed from the Part. |
| An Attachment or an emitter already transformed, inside the Part | It is kept in the RenderTemplate. |
| Any other child of the Part | It is not kept in the RenderTemplate. |
| Thickness row | It takes the smaller of the Part’s X and Y size, and at least 0.05 studs. |
| Color and Transparency rows | They take the Part’s colour and transparency. |
| Material | It stays on the RenderTemplate. The Material row edits it. |
| HUD ▸ Emit box | It reads 1. |
The Part’s Size is not kept as a row. The length of a segment comes from the bolt. Its width comes from Thickness.
Because the Emit count starts at 1, the Emit button makes one bolt straight after the transform.
The Explorer shows five things inside the emitter: PartIcleProperties, RenderTemplate, EmitParent, ShapePart and Target. The last three hold the Emit Into, Shape Part and Target rows. See EmitParent, Link, AccelTarget, ShapePart.
A stock ParticleEmitter in the Part is not carried over. Put it into the RenderTemplate after the transform.
To change the look later, edit the RenderTemplate in Studio, or use the Appearance rows.
Emission
Section titled “Emission”| Row | Kind | Starts at | Unit | What it does |
|---|---|---|---|---|
| Mode | List | Emit | Emit makes a new bolt at every emit. Animate plays one bolt in place. | |
| Loop | Switch | Off | Animate mode only. Repeats the cycle until switched off. | |
| Enabled | Switch | Off | Emit mode only. Makes bolts at the Rate until switched off. | |
| Rate | Number | 10 | Bolts per second | How many bolts are made each second while Enabled is on, or during a Duration. Hidden in Animate mode. |
| Lifetime | Two numbers | 1 | Seconds | How long one bolt lasts. Each bolt picks a value between the two. |
| Linger | Number | 0 | Seconds | After its Lifetime the whole bolt stays frozen in its last frame for this long. |
| Timescale | Graph | 1 | The speed of the bolt’s own clock. |
The Emit, Delay and Duration boxes on the HUD fire a Lightning emitter as they fire any other. After the Delay, the Emit count of bolts is made at once. With a Duration above 0, the emitter then runs at its Rate for that long. The rows are described in full on Emission and the HUD.
Emit mode and Animate mode
Section titled “Emit mode and Animate mode”| Emit mode | Animate mode | |
|---|---|---|
| What exists | A new bolt at every emit. Several can be alive at once. | One bolt for the emitter. |
| Fired again while a bolt is alive | Another bolt is added. | The press is ignored until the bolt ends. |
| End of a cycle without Loop | The bolt is removed after its Linger. | The bolt holds its last frame for the Linger, then is removed. |
| Loop on | Not used. | The same bolt lives on from cycle to cycle. |
| Emit count | Used. | Not used. |
| Even dots | Used. | Not used. The axis picks at random. |
| Pool | Used if on. | Not used. |
With Loop on, four things happen at the start of each cycle:
- Every row is read again, and every two-number row picks a new value.
- Growth Speed starts from the beginning.
- A
Seekbolt drops its strike point and searches again. - The bolt reshapes once, and the Impact disk is made again.
An edit made while a loop runs shows at the start of the next cycle.
Timescale on a bolt
Section titled “Timescale on a bolt”| Timescale | What you see |
|---|---|
Above or below 1 | Reshapes, the Scroll wave, Growth Speed and the Motion rows all run faster or slower. |
0 | The bolt freezes. It does not reshape and does not grow. |
Below 0 | Growth Speed runs backwards and the drawn part of the bolt shortens. The Motion rows unwind. The bolt keeps flickering. |
Appearance
Section titled “Appearance”| Row | Kind | Starts at | Unit | What it does |
|---|---|---|---|---|
| Material | List | The Part’s material | The material of every segment. A change shows from the next bolt. | |
| Color | Colour | The Part’s colour | The colour of the bolt over its life. | |
| Gradient | Colour | White | The colour along the bolt, from the source to the tip. Plain white switches it off. | |
| Brightness | Graph | 1 | Multiplies the colour, over the bolt’s life. It is not a light. | |
| Transparency | Graph | The Part’s transparency | 0 to 1 | Fades the bolt over its life. |
| Thickness | Graph | The smaller of the Part’s X and Y size | Studs | The width of the bolt over its life. |
| Taper | Graph | 1 | The width along the bolt, as a multiple of Thickness. |
Material writes straight to the RenderTemplate. The row shows the material the RenderTemplate has now. Neon is what makes a bolt glow.
Color and Gradient are both drawn as gradients, and they read differently. On Color, the left end is the birth of the bolt and the right end is the end of its life. On Gradient, the left end is the source of the bolt and the right end is its tip. The two are multiplied together. A fork takes the Gradient colour of the place where it leaves the bolt.
Color also tints a Decal or a Texture on the segments, and Transparency fades it.
Brightness multiplies each part of the colour, and no part can go above full. On a white bolt a value above 1 changes nothing. A value below 1 darkens the bolt. For a bolt that lights the scene, see Nesting.
Thickness is measured in studs. A segment is as wide as it is tall. A bolt is never thinner than 0.05 studs.
Taper is a graph along the bolt, not over its life. The left end of the graph is the source and the right end is the tip.
| Taper graph | Result |
|---|---|
| Flat at 1 | No taper. The row starts this way. |
| From 1 to 0 | The bolt thins to a point at its tip. |
| From 0 to 1 and back to 0 | The bolt is sharp at both ends. |
A value below 0 counts as 0. The limit of 0.05 studs still applies. A fork starts at the width of its branch point and ends at the tip value.
Forks are thinner than the main bolt. No row sets this.
These rows move and turn the start of the bolt. Position, Rotation, the Even dots, the Cycle rows, Rot Order and axis linking work as on a Part emitter. They are described on Spawn.
| Row | Kind | Starts at | Unit | What it does |
|---|---|---|---|---|
| Dir. Mode | List | RigidLocal | How Bolt ▸ Direction is read in Directional mode. | |
| Rot Order | List | Global | The order in which the three Rotation angles are combined. | |
| Rotation | Two numbers for each of X, Y, Z | 0 | Degrees | A rotation picked for each bolt. |
| Rot. Cycle | Two numbers | 0 | Bolts | The length of one even sweep of Rotation. Shown while a Rotation Even dot is on. |
| Pos. Mode | List | Local | The axes the Position offset is measured along. | |
| Position | Two numbers for each of X, Y, Z | 0 | Studs | Moves the start of each bolt. |
| Pos. Cycle | Two numbers | 0 | Bolts | The length of one even sweep of Position. Shown while a Position Even dot is on. |
| Use shape | Switch | Off | Scatters the starts of bolts inside a shape. Shows the five rows below. | |
| Shape | List | Box | The shape: Box, Sphere, Cylinder or Disc. It takes its measurements from the shape part’s Size. | |
| Bolt Direction | List | Emitter | Whether the shape also sets the direction of the bolt. | |
| Radial Dir | List | Outward | With Bolt Direction Radial: Outward, Inward or InAndOut. | |
| Hollow | Number | 0 | 0 to 1 | At 0 the whole shape is used. At 1 only its outer surface or rim is used. |
| Shape Part | Instance, picked with * | The emitter itself | Another part whose Size and position give the shape. |
Dir. Mode
Section titled “Dir. Mode”| Option | Bolt ▸ Direction runs along |
|---|---|
RigidLocal | The emitter’s own axes. The Rotation row does not turn the bolt. |
Local | The emitter’s axes, turned by the Rotation picked for that bolt. This is the mode for crowns and fans. |
Global | The axes of the world. Rotating the emitter does not turn the bolt. |
Rotation and Position
Section titled “Rotation and Position”Rotation always turns the axes of a Local Position offset and of a Local Displacement. It turns the direction of the bolt only when Dir. Mode is Local.
Pos. Mode Local measures the offset along the emitter’s axes, after the Rotation. Global measures it along the axes of the world.
Position is applied again at every reshape, against the place the emitter has at that moment. A pattern of bolts therefore rides a moving emitter.
In a burst, each bolt takes its own step of an Even axis. Rotation Y 0, 360 with its Even dot on and Emit 8 gives eight bolts at equal angles.
Use shape
Section titled “Use shape”| Bolt Direction | Result |
|---|---|
Emitter | The shape only scatters where bolts start. Each bolt still goes along Direction, tilted by SpreadAngle. |
Radial | Each bolt goes along the outward direction of the shape at its start point. |
Radialapplies in Target ModeDirectionalonly.- Radial Dir matters only with Bolt Direction
Radial.Inwardreverses the direction.InAndOutreverses it for a random half of the bolts. The row shows in either case. - Hollow has no effect on a
Box. - Shape Part accepts a Part or a MeshPart. The shape then takes that part’s Size and follows its position.
- There is no Look at initially row on a Lightning emitter.
Motion
Section titled “Motion”These rows move the start of the bolt over its life. They do not throw the bolt like a projectile. The graphs and boxes of Speed, Acceleration, Drag, Displacement and Turbulence work as on a Part emitter. They are described on Motion.
| Row | Kind | Starts at | Unit | What it does |
|---|---|---|---|---|
| Speed | Graph | 0 | Studs per second | Slides the start along the bolt’s own direction. |
| Acceleration | Three numbers, x, y, z | 0, 0, 0 | Studs per second per second | A drift of the start that grows steadily, along the axes of the world. |
| Drag | Number | 0 | Slows the Speed as the bolt ages. | |
| Displacement Mode | List | Global | The axes used by Displacement, Turbulence and Bolt ▸ Sag. | |
| Displacement | Graph for each of X, Y, Z | 0 | Studs | An offset of the start over the bolt’s life. |
| Turbulence | Graph | 0 | Studs | A smooth random wander of the start. The value is how far it wanders. |
| Turb. Frequency | Number | 1 | How fast the wander changes. |
The bolt’s own direction depends on Target Mode. In Directional it is the launch direction. In Point and Seek it points toward the end of the bolt.
| Displacement Mode | Axes |
|---|---|
Global | The axes of the world. |
Local | The emitter’s axes, turned by the Rotation picked for that bolt. |
RigidLocal | The emitter’s axes. |
What moves with the start depends on Target Mode:
| Target Mode | Result of moving the start |
|---|---|
Directional | The end is a set Length from the start, so the whole bolt travels. |
Point | The end stays on the Target. The bolt stretches or shortens. |
Seek | The strike point stays where it was found, unless Retarget is on. |
A two-number row gives each bolt a value of its own. The bolt picks it when it is made, and again at each cycle of an Animate loop.
| Row | Kind | Starts at | Unit | What it does |
|---|---|---|---|---|
| Target Mode | List | Directional | How the end of the bolt is chosen: Directional, Point or Seek. | |
| Target | Instance, picked with * | None | The end of the bolt in Point mode. | |
| Seek Radius | Two numbers | 30 | Studs | How far a Seek bolt looks for a surface. A value below 1 counts as 1. |
| Retarget | Switch | Off | Off, a Seek bolt keeps one strike point. On, it searches again at every reshape. | |
| Seek Bias | Number | 0 | 0 to 1 | At 0 every surface found is equally likely. At 1 the nearest one found almost always wins. |
| Retarget Speed | Number | 0 | Studs per second | At 0 the strike point jumps. Above 0 it slides to each new point at this speed. |
| Direction | List | Top | The face of the emitter the bolt leaves from. Top is the Part’s up axis. | |
| SpreadAngle | Two numbers, x, y | 0, 0 | Degrees | Tilts each bolt by a random angle, up to x on one axis and up to y on the other. |
| Length | Two numbers | 20 | Studs | The straight distance from the start to the end. A value below 0.1 counts as 0.1. |
| Growth Speed | Two numbers | 0 | Studs per second | At 0 the whole bolt appears at once. At any other value the bolt is drawn along its length at this speed. |
| Shape Mode | List | Jitter | How the bolt moves: Jitter, Scroll or JitterScroll. | |
| Segments | Two numbers | 12 | Count | The straight pieces in the main bolt, from 2 to 64. |
| Amplitude | Two numbers | 0.15 | Share of the bolt’s length | How far the bolt strays from a straight line. |
| Amp. Decay | Two numbers | 0.5 | 0 to 1 | How much smaller the fine zigzags are than the large ones. |
| Jitter Rate | Two numbers | 15 | Reshapes per second | How often the bolt reshapes. At 0 the shape is made once and kept. |
| Scroll Speed | Two numbers | 1 | Waves per second | How fast the wave travels along the bolt. A negative number reverses the travel. |
| Waves | Two numbers | 3 | Count | How many waves fit along the bolt. A value below 0.25 counts as 0.25. |
| Sag | Two numbers | 0 | Share of the bolt’s length | The droop of the whole bolt at its middle. A negative number arches it upward. |
| Sag Shape | Two numbers | 1 | The outline of the droop. | |
| Fork Chance | Two numbers | 0 | 0 to 1 | The chance that each possible fork shows at each reshape. At 0 there are no forks. |
| Fork Depth | Two numbers | 0 | 0 to 2 | 0 gives no forks. 1 gives forks off the main bolt. 2 adds forks off those forks. |
| Fork Length | Two numbers | 0.4 | Share of the bolt’s length | The length of a fork. |
A two-number row also takes one number, which serves for both. A row keeps the number as typed. The limits in the table are applied when a bolt is made.
The rows shown depend on Target Mode and Shape Mode:
| Rows | Shown when |
|---|---|
| Target | Target Mode is Point |
| Seek Radius, Retarget, Seek Bias, Retarget Speed | Target Mode is Seek |
| Direction, SpreadAngle, Length | Target Mode is Directional |
| Growth Speed | Target Mode is Directional or Seek |
| Scroll Speed, Waves | Shape Mode is Scroll or JitterScroll |
| Every other row | Always |
When the selected Lightning emitters differ in mode, every row shows.
Target Mode
Section titled “Target Mode”Directional. The bolt leaves the start along Direction, tilted by SpreadAngle. It ends Length studs away. Spawn ▸ Dir. Mode decides which axes Direction is read on. With Use shape on and Bolt Direction Radial, the direction comes from the shape.
Point. The bolt runs from the start to the Target. The Target row accepts a Part, a MeshPart, an Attachment, a Model, a Bone or the Camera. The picking box has a Clear button.
- The end of the bolt is the centre of a Part, the place of an Attachment, or the pivot of a Model. On a Bone it is the animated place.
- The Target is read again at every reshape. A moving Target is followed, in steps at the Jitter Rate.
- If the Target is removed while a bolt is alive, the end stays at its last place.
Seek. Each bolt looks around its start for surfaces within Seek Radius, and strikes one of them.
- Seek finds surfaces: floors, walls, and any part with collisions on. It does not home in on players, enemies or a chosen object.
- Seek samples the surroundings. Large, near surfaces are found far more often than small or distant ones.
- To prefer near surfaces, raise Seek Bias. To strike one chosen thing, use
Point. - With no surface found, the bolt arcs into open air. It goes in a random direction, for half the Seek Radius.
What counts as a surface:
| Counts | Does not count |
|---|---|
| A part with CanCollide on | A part with CanCollide off |
| Terrain | Water |
The emitter, its RenderTemplate, and the plugin’s own particles | |
| The Emit Into instance and everything inside it | |
| Whatever the Hit Filter leaves out |
Retarget and Retarget Speed decide how the strike point behaves over the bolt’s life:
| Retarget | Retarget Speed | The strike point |
|---|---|---|
| Off | Any | Is chosen once. The bolt still reshapes around it. |
| On | 0 | Is searched for again at every reshape. It flickers between surfaces at the Jitter Rate. |
| On | Above 0 | Slides to each new point at that speed. The next search waits until the slide has arrived. |
With a Retarget Speed above 0, the bolt drags its end across surfaces from one point to the next. The first strike of a bolt always appears in place, with no slide.
Growth Speed
Section titled “Growth Speed”Growth Speed draws the bolt along its length, at a speed in studs per second.
| Growth Speed | Result |
|---|---|
0 | The whole bolt appears at once. |
| Above 0 | The bolt is drawn from the source toward the tip. |
| Below 0 | The far end appears first, and the bolt fills in back toward the source. |
Two numbers, such as 300, 800 | Each bolt picks a speed of its own. |
Two numbers on either side of 0, such as -200, 200 | Some bolts are drawn from the source and some from the far end. |
- The distance is measured along the zigzag, which is a little longer than the straight Length.
- With Length 20 and Growth Speed 100, the bolt is fully drawn after a little over 0.2 seconds.
- With Length 20, Growth Speed 20 and Lifetime 1, the bolt ends before it is fully drawn.
- A fork appears when the growth reaches its branch point. It then grows at the same speed.
- Below 0, the far end is the farthest tip of the bolt, forks included.
- The growth follows the bolt’s own clock. A Timescale of
2doubles it. A Timescale below 0 runs it backwards. - A bolt does not shrink back by itself at the end of its life.
Shape Mode
Section titled “Shape Mode”| Shape Mode | What you see | What the Jitter Rate does |
|---|---|---|
Jitter | A random zigzag that snaps to a new random zigzag at each reshape. | Reshapes the whole bolt. |
Scroll | A smooth wave that travels along the bolt every frame. The two ends stay fixed. | Makes new forks only, and reads the end points again. |
JitterScroll | A random zigzag with the travelling wave laid on top. | Reshapes the zigzag and the forks. |
In the two Scroll modes:
- The size of the wave is Amplitude times the length of the bolt.
- A second, finer wave rides on the first. Amp. Decay sets its size.
- Waves sets how many waves fit along the bolt. Scroll Speed sets how fast they travel.
- A negative Amplitude mirrors the wave to the other side.
- Forks stay attached to the moving bolt, and each waves by itself.
Amplitude, Amp. Decay and Sag
Section titled “Amplitude, Amp. Decay and Sag”Amplitude is a share of the bolt’s length. At 0.15 on a bolt of 20 studs, the middle strays up to 3 studs sideways. At 0 the bolt is straight.
Amp. Decay compares each finer level of zigzag with the level above it.
| Amp. Decay | Result |
|---|---|
0.5 | Each finer level is half as large as the one before. |
| Near 1 | The bolt is jagged at every scale. |
| Near 0 | One large bend, and smooth otherwise. |
Sag is a share of the bolt’s length. At 0.2 on a bolt of 20 studs, the middle hangs 4 studs lower. Down is set by Motion ▸ Displacement Mode. With Global it is the world’s down. Forks do not sag.
Sag Shape sets the outline of the droop:
| Sag Shape | Outline |
|---|---|
1 | A parabola. |
| Above 1 | More pointed. |
0.5 | A true arc of a circle. With a large Sag it bulges past a half circle into a horseshoe. |
0 | A square trough. |
| Between these | A blend of the two nearest. |
Jitter Rate and the reshape
Section titled “Jitter Rate and the reshape”A reshape is the only moment a bolt reads the world again. At a reshape the bolt reads the place of the emitter and of the Target. It applies the Spawn and Motion offsets. A Seek bolt with Retarget on searches again.
The plugin builds the zigzag again from the rows at each reshape. With Jitter Rate at 15 that is 15 times a second.
- An Animate bolt with Loop on reshapes once at the start of each cycle, even at Jitter Rate 0.
- A low Jitter Rate makes a bolt on a moving object lag behind it in steps. Keep the Jitter Rate at or above the number of steps a second the tracking needs.
- Forks are decided again at each reshape, so they come and go at the Jitter Rate. At Jitter Rate 0 the forks made with the bolt stay.
- In a very heavy scene, a bolt may reshape one frame late.
Forks and the part limit
Section titled “Forks and the part limit”A bolt has at most 64 parts. The main bolt and its forks share them. A bolt has at most 6 forks.
| Fork Depth | Forks at one time |
|---|---|
0 | None. |
1 | At most 3, all off the main bolt. |
2 | At most 6. Up to three leave the main bolt, and up to three leave a fork. |
- A value of 3 or more behaves as 2. A value with a fraction is rounded.
- A fork off a fork shows only when a fork off the main bolt showed in the same reshape.
- Each fork has about half as many pieces as the main bolt. With Segments 12, a fork has 6 pieces, and 6 forks bring the bolt to 48 parts.
- Segments 64 leaves no room for forks.
- Fork Length is applied once for each level. At 0.4 on a bolt of 20 studs, forks are 8 studs long. Forks off those forks are 3.2 studs long.
- A fork is never shorter than 1 stud. Its zigzag shrinks by the same share as its length.
- Each fork leaves at a random point of the main bolt, or at the middle of the fork it grows from. It leaves at a moderate angle. No row sets the angle.
- Forks do not strike anything. They never fire On Hit.
Impact
Section titled “Impact”The Impact section adds a thin, flat disk at the place the bolt lands.
| Row | Kind | Starts at | Unit | What it does |
|---|---|---|---|---|
| Impact Disk | Switch | Off | Adds the disk. The rows below show only while it is on. | |
| Disk Mode | List | Follow | Follow ties the disk to the bolt’s Thickness and Transparency. Manual uses the disk’s own graphs. | |
| Disk Size | Graph | 2 | Studs | The width of the disk across, over the bolt’s life. Never smaller than 0.05 studs. |
| Disk Transp. | Graph | 0 | 0 to 1 | The transparency of the disk. Manual only. The row is hidden in Follow. |
| Disk Bright. | Graph | 1 | Multiplies the disk’s colour, as Brightness does. Manual only. The row is hidden in Follow. | |
| Disk Texture | Text | Empty | An image shown on the outward face of the disk. | |
| Disk Offset | Number | 0.05 | Studs | How far the disk is lifted off the surface, so the two do not flicker. |
Where the disk shows
Section titled “Where the disk shows”The disk exists only while the bolt lands on a surface. A bolt that ends in the air shows no disk.
| Target Mode | The disk sits at |
|---|---|
Seek | The strike point. |
Point and Directional | The first surface on the straight line from the start of the bolt to its end. |
- The surface rules are those of
Seek, in the table under Target Mode. - A
PointTarget with CanCollide off gives no disk. Neither does an Attachment in open air. - The disk does not shorten the bolt. In
Directionalmode a wall halfway along gets the disk, and the bolt carries on through the wall. - The disk lies flat on the surface.
- The disk moves when the bolt reshapes.
- The disk is removed with the bolt. In Emit mode that is after the Linger.
How the disk looks
Section titled “How the disk looks”- The colour of the disk always follows the tip of the bolt. It is the Color row, times the Brightness, times the right end of the Gradient. There is no separate disk colour.
- The material of the disk is the material of the
RenderTemplate. - Taper does not change the disk.
In Follow mode, Disk Size is the size at full opacity and at the Thickness the bolt started with. The disk grows and shrinks with Thickness, and shrinks as the bolt fades.
| Disk Size | Thickness now, against Thickness at the start | Transparency | Width of the disk |
|---|---|---|---|
| 2 | The same | 0 | 2 studs |
| 2 | The same | 0.5 | 1 stud |
| 2 | Half | 0 | 1 stud |
Disk Texture
Section titled “Disk Texture”The hint in the empty box reads rbxassetid://... or none. With an image set, only the image shows, and the body of the disk is hidden. Enter none to clear the row.
Events
Section titled “Events”A Lightning emitter has the four event blocks and a Hit Filter row. Events are described in full on Events.
| Event | On a Lightning emitter |
|---|---|
| On Emit | Present. |
| On Death | Present. |
| On Destruction | Present. |
| On Hit | Present only while Target Mode is Seek. |
On Hit
Section titled “On Hit”On Hit fires when a Seek bolt finds a strike point on a surface.
| Case | On Hit fires |
|---|---|
| Retarget off | Once, when the bolt is made. |
| Retarget on, Retarget Speed 0 | When the bolt is made, and again at each new strike point. |
| Retarget on, Retarget Speed above 0 | When the bolt is made, and each time the slide arrives at a new point. |
| No surface found | Not at all. |
An event script receives the instance that was struck, the position, and the direction the surface faces. See The event script and its payload.
Where On Emit and On Death place a target
Section titled “Where On Emit and On Death place a target”With Mode AtPosition, a target fired by On Emit, On Death or On Destruction appears at the start of the bolt. It does not appear at the tip.
To act at the tip, use Seek with On Hit, or use the Impact disk.
In an event script, payload.SetColor and payload.SetTransparency act on every segment of the bolt.
Hit Filter
Section titled “Hit Filter”The Hit Filter row is at the top of the Events section. It belongs to the emitter, not to On Hit. It limits what Seek and the Impact disk count as a surface, and it applies while On Hit is off.
A Lightning emitter as the target of an event
Section titled “A Lightning emitter as the target of an event”Another emitter’s event can fire a Lightning emitter. Pick it in the event’s Emit row. Its Emit count of 1 means it fires with no more setup.
- The start of the bolt is fixed at the spot of the event for the bolt’s whole life. It does not follow anything.
- Mode
AtPositionuses that spot with the Lightning emitter’s own rotation. - Mode
AtCFrameuses that spot, turned the way the event’s particle was turned. - The Position, Rotation and Use shape rows still apply on top.
Advanced
Section titled “Advanced”| Row | Kind | Starts at | What it does |
|---|---|---|---|
| Anim. Steps | Number | 100 | How many times the appearance graphs are read over one Lifetime. |
| Emit Into | Instance, picked with * | None | Where the parts of a bolt are placed in the Explorer. |
| Preload Texture | Switch | Off | Keeps every texture the emitter uses loaded, so the first bolt does not show blank textures. |
| Pool | Switch | Off | Reuses finished bolts in place of making new ones. For emitters with a high Rate. |
Anim. Steps acts on Color, Brightness, Transparency, Thickness and the disk graphs. The shape of the bolt does not use it. The bolt reshapes at its Jitter Rate, on a clock of its own. A value of 0 or less counts as 100.
Emit Into does not change where a bolt appears.
Nesting
Section titled “Nesting”Nesting is described in full on Nesting.
| What is put where | Result |
|---|---|
A transformed emitter inside the Lightning RenderTemplate | It fires once for each bolt, at the start of the bolt. It does not fire once for each segment. |
A Light emitter inside the Lightning RenderTemplate | Every segment of the bolt carries the light, so the whole bolt glows. |
A stock ParticleEmitter, Trail or Beam inside the RenderTemplate | Every segment has one of its own, because every segment is a duplicate of the RenderTemplate. |
A Lightning emitter inside the RenderTemplate of a Part, Attachment or Model emitter | The bolt starts at the parent particle and rides it. |
- The nested emitter’s own Emit, Delay and Duration decide what it does for each bolt.
- With Mode
Animateand Loop on, nested emitters fire again at every cycle. - All the lights on a bolt follow the Light emitter’s graphs and are removed with it.
- A stock Trail or Beam in the
RenderTemplateruns only with a Duration above 0. See Editing stock ParticleEmitters, Trails and Beams.
With the tools
Section titled “With the tools”| Tool | Effect on a Lightning emitter |
|---|---|
| Size | Multiplies the Thickness, Speed, Displacement, Turbulence and Disk Size graphs. Multiplies Acceleration, Length, Position, Seek Radius, Growth Speed, Retarget Speed and Disk Offset. |
| Time | Multiplies Rate, Drag, Turb. Frequency, Retarget Speed, Jitter Rate, Scroll Speed, Growth Speed and the Speed graph. Divides Lifetime. Multiplies Acceleration by the square of the factor. |
Size does not change Amplitude, Sag or Fork Length. They are shares of the bolt’s length, so they follow Length. It does not change Taper, Segments or SpreadAngle.
Time does not change Linger or Anim. Steps. It divides the Delay and Duration on the HUD, as for every emitter.
The tools are described on Size and Time.
Motion Preview does not draw a Lightning emitter.
Limits
Section titled “Limits”- A bolt has at most 64 parts and 6 forks. Segments runs from 2 to 64.
- A bolt passes through everything. Only
Seekand the Impact disk look at the world. Seekdoes not aim at characters or chosen objects. It finds surfaces.- Jitter Rate 0 stops the bolt from following anything.
- On Emit and On Death place a target at the start of the bolt, not at its tip.
- Sag does not show on a bolt that runs along the sag direction. A vertical bolt with Displacement Mode
Globalis one case. - There is no Link. The bolt follows the emitter Part itself.
- An edit acts on bolts made after it. A bolt that is alive keeps the values it picked. An Animate loop takes the edit at its next cycle.
- A bolt has no light of its own. Brightness only scales its colour.
What makes a Lightning emitter cost more:
| Setting | Why |
|---|---|
| Segments and forks | More parts are moved at every reshape. |
| Jitter Rate | More reshapes each second. |
Shape Mode Scroll or JitterScroll | The bolt is redrawn every frame. |
| Rate times Lifetime | More bolts alive at once. |
Retarget in Seek mode | A new search at every reshape, for every bolt. |
| A nested Light | One light for every segment. |