Lesson 6 of 6

VFX: particles, beams, trails, lighting effects

Roblox visual effects from Beacon Yard's real code, covering particle emitters, bursts, beams, trails, attachments, lights, post-processing, flipbooks and the budgets that keep phones smooth.

Project lesson, about 55 minutes, 12 steps

By the end you can

  • Tune a ParticleEmitter's rate, lifetime, speed, size and transparency, and choose between a running Rate and an Emit burst
  • Use Attachments with Beams and Trails, and light a scene with lights, post-processing effects and Highlights
  • Estimate a particle budget, use flipbooks carefully, and keep effects cheap on phones

Before this: Audio: recording, editing, licensing, the audio graph, World building in code: MapBuilder, lighting, atmosphere

Step 1 of 12

Look at the glow above the pads

Start a playtest at m06-drone-wrench and look past the coins. Tiny sparks rise above each yellow pad, a few more drift up from the beacon crystal, and the lamp in the physics exhibit sheds slow warm motes. None of them are parts. Each is a ParticleEmitterParticleEmitterAn object that keeps spawning small images that move, change size and fade.Think of it as a sprinkler for sprites., a single object that keeps spawning small images that move, shrink and fade.

The exhibit lamp's motes, then the drill start and its lighting shift.

Transcript
  1. 0:05 The coin plays electronicpingshort through SoundClient.
  2. 0:10 LampMotes emit upward at 8 particles a second.
  3. 0:16 Drill start plays the victory cue and shifts ClockTime to 18.4.
	motes.Name = "LampMotes"
	motes.Rate = 8
	motes.Lifetime = NumberRange.new(1.4, 2.2)
	motes.Speed = NumberRange.new(0.3, 0.9)
	motes.SpreadAngle = Vector2.new(12, 12)
	motes.LightEmission = 0.45
	motes.EmissionDirection = Enum.NormalId.Top
	motes.Acceleration = Vector3.new(0, 0.4, 0)
	motes.Size = NumberSequence.new({
		NumberSequenceKeypoint.new(0, 0.2),
		NumberSequenceKeypoint.new(1, 0.05),
	})
	motes.Transparency = NumberSequence.new({
		NumberSequenceKeypoint.new(0, 0.25),
		NumberSequenceKeypoint.new(1, 1),
	})
	motes.Color = ColorSequence.new(Color3.fromRGB(255, 214, 150))
	motes.Parent = lamp
Work it out

LampMotes has Rate 8 and a Lifetime between 1.4 and 2.2 seconds. About how many motes are alive at once? Use the average lifetime.

Link to this step · This confused me

Step 2 of 12

What each property does

An emitter spawns particles inside its parent part's volume, or at an Attachment's point, and sends them out of the face named by EmissionDirection1. The properties fall into three groups:

  • How many: Rate is particles per second. A single emitter can create up to 400 per second, or 100 on mobile.
  • How long and how fast: Lifetime is a range in seconds, capped at 20. Speed is a range in studs per second. SpreadAngle widens the cone, Acceleration and Drag bend and slow it.
  • How it looks: Texture, Color, LightEmission (how much it glows), and Size and Transparency, which are sequences: curves over the particle's life. The lamp's motes start at size 0.2 and 25 percent transparent and end at size 0.05 and invisible.
Match the pairs

Match each change to the property that makes it.

Link to this step · This confused me

Step 3 of 12

Bursts: Emit instead of Rate

A running Rate is right for ambience. Feedback wants a burst: twelve sparks at once, then nothing. At m07-feel, Beacon Yard adds VfxClient, which builds a hidden anchor part where something happened, gives it an emitter with Rate = 0, calls Emit(count) once, and lets Debris remove the part after the last spark fades.

	local emitter = Instance.new("ParticleEmitter")
	emitter.Texture = SPARK_TEXTURE
	emitter.Color = ColorSequence.new(style.color)
	emitter.LightEmission = 1
	emitter.Rate = 0
	emitter.Lifetime = NumberRange.new(LIFETIME * 0.5, LIFETIME)
	emitter.Speed = NumberRange.new(if reduced then style.speed * 0.3 else style.speed * 0.6, style.speed)
	emitter.SpreadAngle = Vector2.new(180, 180)
	emitter.Drag = 4
	emitter.Size = NumberSequence.new({
		NumberSequenceKeypoint.new(0, style.size),
		NumberSequenceKeypoint.new(1, 0),
	})
	emitter.Transparency = NumberSequence.new({
		NumberSequenceKeypoint.new(0, 0),
		NumberSequenceKeypoint.new(1, 1),
	})
	emitter.Parent = anchor
	anchor.Parent = workspace
 
	local count = if reduced then math.max(1, math.floor(style.count * Config.VFX_REDUCED_SHARE)) else style.count
	emitter:Emit(count)
	Debris:AddItem(anchor, LIFETIME + 0.5)

The counts live in Config: 14 sparks for a coin, 18 for a hit on the drone, 10 when the wrench reaches its Impact frame. With reduced motion on, each burst keeps 30 percent (VFX_REDUCED_SHARE) and the sparks move slower. The bursts run on the client, because the server already told this player what happened on the Feedback remote.

Work it out

A player with reduced motion picks up a coin. How many sparks does VfxClient emit? (count = max(1, floor(14 * 0.3)))

Link to this step · This confused me

Step 4 of 12

Attachments, beams and trails

An AttachmentAttachmentA point with an orientation, stuck to a part, that other objects can use as an anchor.Think of it as a pin with an arrow, fixed to a part. is a point with an orientation, stuck to a part. On its own it draws nothing. Effects use attachments as anchors:

  • A Beam draws a textured strip between Attachment0 and Attachment1. CurveSize0 and CurveSize1 bend it into a curve, Segments sets how smooth the curve is, and FaceCamera keeps it facing the viewer2. Use it for lasers, ropes of light, a tether from the drone to its target.
  • A Trail draws a ribbon behind two attachments as they move; the distance between them is the ribbon's width, and Lifetime is how long it lingers3. Use it for a sword slash, or the head of Beacon Yard's wrench.
Go deeper Why a Trail needs two attachments

A trail is a ribbon, so it needs a width as well as a length. The distance between its two attachments is the ribbon's width, and the path they travel is its length. Attachments that sit closer together make a thinner trail.

Choose one

You want a short glowing arc behind the wrench head while it swings. Which effect fits?

You want a short glowing arc behind the wrench head while it swings. Which effect fits?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 5 of 12

Light, post-processing and highlights

Light is the biggest effect in the yard. MapBuilder puts a PointLight on the beacon pedestal, the shop and each sign; the exhibit lamp's light has Brightness 1.4 and a Range of 14 studs. A PointLight shines in every direction, a SpotLight in a cone, a SurfaceLight from one face4.

On top of the lights sit post-processing effects under Lighting: BloomEffect makes bright things glow, ColorCorrectionEffect shifts contrast and tint, SunRaysEffect and DepthOfFieldEffect do what their names say5. WorldLook adds an Atmosphere, a bloom and a colour correction for the dusk look, and the drill moves ClockTime to 18.4.

A Highlight outlines a model through walls. The drone has one, StunHighlight, which turns on only while it is stunned. Each client draws at most 255 highlights; past that they are silently dropped6. A disabled Highlight still holds one of those slots, so in a crowd of drones remove the Highlight instead of toggling Enabled.

Choose one

A teammate wants a Highlight on every coin so players spot them. Why is that a poor idea?

A teammate wants a Highlight on every coin so players spot them. Why is that a poor idea?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 6 of 12

Flipbooks

A flipbook is one texture holding a grid of frames, played in order over a particle's life, so each spark can be a tiny animation such as a puff of smoke or an explosion. The layout is 2×2, 4×4, 8×8 or a custom grid; a 1024 by 1024 image in an 8×8 layout gives 64 frames. FlipbookFramerate goes up to 30 frames per second, and FlipbookMode picks Loop, OneShot, PingPong or Random1.

Flipbooks cost memory. When a device runs low, the client switches flipbooks off automatically, which is likely on older phones. Use a few, at the smallest texture that still reads, and leave spacing between frames so mipmaps do not bleed one frame into the next.

Go deeper What fill-rate means

Fill-rate is how many pixels the GPU has to colour each frame. A few large, transparent particles that overlap can cost more than many small ones, because each overlapping layer is drawn again. Keep particles small, and give flipbook textures only as many pixels as the effect needs.

Work it out

A flipbook uses the Grid4x4 layout in OneShot mode on particles that live 0.8 seconds. How many seconds is each frame shown?

Link to this step · This confused me

Step 7 of 12

A budget for particles

Particles cost twice. Each one is drawn, and overlapping transparent particles make the GPU draw the same pixel many times, which is called overdraw. Big particles cost more than many small ones because they cover more pixels, which the docs call fill-rate1. Phones feel this first.

A simple budget is "particles alive at once", rate times average lifetime, summed over every emitter you can see.

Luau
Ctrl Enter runs the cell. Checked against the expected output

About fifty small, faint motes is a light load for the whole yard. A single explosion with a rate of 400 and a lifetime of 2 seconds would be 800 on its own, which is why bursts use Emit with a small count.

Choose one

An emitter has Rate 300. What happens on a phone?

An emitter has Rate 300. What happens on a phone?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 8 of 12

Effects that follow the round

The lamp's motes could get busier during a drill. The server already writes the phase on a AttributeAttributeA named value you attach to any instance with SetAttribute and read with GetAttribute.Think of it as a sticky note on an instance.: Workspace.RoundPhase. Any script can listen for it to change and set the emitter's Rate.

An attribute is a sticky note on an instance. RoundService writes "Active" on Workspace's note, and every script that cares reads it. The lamp does not need to know RoundService exists.

Think of it as Sticky notes on an instance

Both sidesRemember: Attributes is sticky notes on an instance.

The note picture breaks in two ways. A sticky note can hold anything you write; an attribute holds only some types (strings, numbers, booleans, Color3, Vector3 and a few more, never a table or an Instance). And a note written on the server is copied to every client, but a note a client writes stays on that client.

Where does it break?“Sticky notes on an instance” is a good picture of attributes. Where does it stop being true?

It breaks here. Notes only travel down: a client that writes a note changes its own copy and the server never sees it; and only a few value types fit on a note.

The true model. Attributes are typed key-value pairs on an instance. Server writes replicate to clients; client writes stay local. They suit small state such as a phase or a health value, not tables or instances.

Choose one

A LocalScript sets Workspace's RoundPhase attribute to "Active". What happens?

A LocalScript sets Workspace's RoundPhase attribute to "Active". What happens?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 9 of 12

How studios make effects

Other ways pros do this

OptionWhat it isWhen pros pick itTrade-offs
Tune in Studio by handInsert emitters, beams and lights in the editor and adjust them live.Ambient effects that never change, artists who are not scripters.Lives in the place file; harder to review and reuse.
Build in codeCreate effects from Luau with values in Config, as MapBuilder and VfxClient do.Effects that respond to gameplay, or a code-first repo like Beacon Yard.Slow to tune; you edit a number, then press Play.
Creator Store effectsReady-made emitters, beams and textures from the Toolbox.Prototypes, or a solo developer without an artist.Check the licence and the scripts inside; common packs look like many other games.
Rendered flipbooks and meshesSimulate smoke or fire in Blender or another tool, render a frame grid, use it as a flipbook texture.Hero effects such as explosions where quality matters.Memory cost, and flipbooks switch off on low-memory phones.
Choose one

Why does VfxClient create its sparks on the client instead of the server?

Why does VfxClient create its sparks on the client instead of the server?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 10 of 12

Build along: a wrench trail

Build along

m06-drone-wrench

  • src/client/CombatClient.luau
  1. In a playtest, select the Wrench tool inside your character, and inside its Handle part (the single part CombatService builds at m06-drone-wrench) insert two Attachments 1 stud apart near the striking end.

    You should see Two Attachments named TrailTop and TrailBottom sit 1 stud apart on Wrench.Handle in Explorer during Play.

  2. Insert a Trail in the same part, set Attachment0 and Attachment1 to the two attachments, Lifetime to 0.2, and Transparency to a sequence from 0.2 to 1.

    You should see A ribbon follows the wrench head when you swing and fades within a quarter of a second.

  3. Copy the numbers into CombatClient.luau: create the attachments and trail from code with Enabled = false, enable the trail when the swing starts and disable it 0.25 seconds later.

    You should see The trail appears only during swings, not while you walk around.

Link to this step · This confused me

Step 11 of 12

Challenges

Level 1, Apprentice

Challenge

Add a vertical beam above the beacon while the drill runs.

Start from
The game at milestone m06 (download)

Done means

  • A Beam joins the beacon crystal to a point 20 studs above it
  • It shows only while RoundPhase is Active
  • It uses a texture that ships with Studio, so it needs no id

Meet the criteria above, then record your own result. No test grades this check.

Level 3, Professional

Challenge

Make the lamp's motes busier during the drill. The test is challenges/audio-vfx.luau and the solution is challenges/solutions/audio-vfx.md.

Start from
The game at milestone m06 (download)
Grade it
To grade work from an earlier milestone, apply your challenge changes to a checkout based on m14-ship, which includes the Course Runner. In Studio, press Play, then run game.ServerScriptService.RunGameTests:Invoke("audio-vfx", "vfx-busy-motes") in the server command bar. Copy the pass code from Output.

Done means

  • LampMotes.Rate is 8 while RoundPhase is Idle or Cooldown
  • It is 30 while RoundPhase is Active
  • It returns to 8 when the phase is Idle again
  • challenges/audio-vfx.luau prints TEST PASS for lamp_rate_idle, lamp_rate_active and lamp_rate_restored

The Course Runner prints this code when the test passes.

Choose all that apply

The level 3 test shortens the round. Which test-only attributes does it set on Workspace?

The level 3 test shortens the round. Which test-only attributes does it set on Workspace?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 12 of 12

Recap

Retiring the analogy

You no longer need “sticky notes on an instance”. Attributes are typed key-value pairs on an instance. Server writes replicate to clients; client writes stay local. They suit small state such as a phase or a health value, not tables or instances.

Recap

  1. A ParticleEmitter's Rate and Lifetime set how many particles live at once; feedback uses Emit bursts with small counts on the client.
  2. Attachments anchor Beams and Trails; lights, post-processing and a few Highlights (255 per client at most) set the mood.
  3. Budget particles as rate times lifetime, remember the 100 per second mobile cap and the memory cost of flipbooks.

Attributes is sticky notes on an instance, until notes only travel down: a client that writes a note changes its own copy and the server never sees it; and only a few value types fit on a note.

Next DataStores: saving without losing a single coin

Link to this step · This confused me

Sources
  1. Particle emitters. Roblox Creator Documentation, checked 2026-11-23.
  2. Beams. Roblox Creator Documentation, checked 2026-11-23.
  3. Trails. Roblox Creator Documentation, checked 2026-11-23.
  4. Light sources. Roblox Creator Documentation, checked 2026-11-23.
  5. Post-processing effects. Roblox Creator Documentation, checked 2026-11-23.
  6. Highlighting. Roblox Creator Documentation, checked 2026-11-23.