This is the Unity version. See the matching Unreal Engine Niagara tutorial.

Back to the elemental comparison and recipes

What you will build

Gather small points of light toward a center, then show a single brief flash. Gather contains the inward-moving points; Flash is one larger particle at the center. Each uses Particle System, Unity’s component for emitting and moving small images. First make Gather move correctly, then time Flash to follow it.

Gather moves points inward, followed by a brief Flash at the center. Flash uses a Start Delay of 0.5 seconds.
Gather moves points inward, followed by a brief Flash at the center. Flash uses a Start Delay of 0.5 seconds.

Preparation: make a small test scene

Use Unity 2022.3 LTS with URP 14 and save a separate practice Scene. A Scene is the workspace containing the floor, camera and effect. Hierarchy lists its objects; Inspector shows settings for the selected object. If you use another Unity version, including Unity 6, menu names and positions may differ.

  1. Right-click an empty area in Hierarchy, choose Create Empty and name it EF_Light. In Inspector, open the Transform menu and choose Reset to restore its position, rotation and scale. Then set its position to (0,1,0). The examples treat one Unity unit as one meter and keep parent scale at (1,1,1).
    Keep the practice scene and its assets together
    Keep the practice scene and its assets together
  2. Place a unit cube at (2,0.5,0) as a size reference, away from the effect origin. Add a floor cube at (0,-0.05,0), scale (4,0.1,4), with its top at Y=0.
    Scale reference
    Scale reference
  3. Frame the origin from an elevated angle in Scene view. Select Main Camera and use GameObject → Align With View, then verify the floor/work area in Game view.
    Match Main Camera to the Scene view
    Match Main Camera to the Scene view
  4. Inspect the Game view in Play mode against mid-gray, initially without bloom or strong grading. Keep a Directional Light for Lit materials, whose shading responds to lights. Bloom is the glow around bright areas; leave it off while checking shapes.
    Enter Play and inspect shape and motion in Game view
    Enter Play and inspect shape and motion in Game view

Build Gather first, then Flash. Check each part on its own before adding the next part.

Object relationships

EF_Light groups the whole effect. In the list below, each indented object is a child of the object above it. Start with the root and add the children in the order explained below.

EF_Light
  Gather
  Flash

How to enter values and curves

A range such as 0.8–1.2 means each particle receives a value between 0.8 and 1.2. Open the menu beside the field, choose Random Between Two Constants and enter the minimum and maximum. Choose Constant for a single value. Lifetime is how many seconds a particle remains; Speed is its distance traveled per second in Unity units. Compare at normal playback speed, timeScale=1.

Size over Lifetime changes a particle’s size while it is alive. Enable the module and open its Curve. Add keys at the stated positions: horizontal zero means the particle has just appeared; one means its lifetime has ended. The vertical value multiplies Start Size. For a particle lasting 0.8 seconds, horizontal 0.25 is 0.2 seconds after it appears.

Color over Lifetime changes particle color and transparency over its lifetime. Click Gradient: lower keys set RGB color; upper keys set Alpha, the transparency value. Alpha 0 is invisible; 1 applies no transparency reduction. You can leave RGB white and still fade Alpha. Values here use 0–1. In a 0–255 picker, 1 becomes 255 and 0.5 becomes about 128.

Select each new Particle System and reset its Transform before entering the position and rotation from its table. In Main, turn Play On Awake on so it starts when you enter Play, and leave Prewarm off. Set Start Color to white with Alpha 1. Sections of settings are called modules. Emission controls particle counts; Burst emits a group at a specified time; Shape controls where particles start and their direction. Leave unspecified extra modules off for this first test.

Build inward-moving particles and a separate central flash that starts at 0.5 seconds.
Build inward-moving particles and a separate central flash that starts at 0.5 seconds.

1. Prepare a grayscale mask

Mask_SoftDot is a mask: white marks the visible shape, black marks hidden areas and gray creates partial transparency. Read R, the red component of this grayscale image, into the material’s opacity. The material adds color later. Finish the material setup below so the black area becomes transparent.

  1. In Photoshop create a 512×512 RGB, 8-bit image with a black background and a separate layer for the white shape.
    RGB / 8 bit
    RGB / 8 bit
  2. Use a soft white brush or white-to-black radial gradient for a roughly 320-pixel disc with black image edges.
    Keep black margins
    Keep black margins
  3. Keep a white center rather than making the entire image uniformly gray; preserve broad coverage for small particles.
    Connect image brightness to opacity: black disappears
    Connect image brightness to opacity: black disappears
  4. Export Mask_SoftDot.png and drag it into Unity Project. Start with Default type, sRGB off, Bilinear filtering and Clamp wrapping; select the imported PNG, click Apply in Inspector, and check that the preview contains the white shape and black margin.
    Connect image brightness to opacity: black disappears
    Connect image brightness to opacity: black disappears

512 is the image size used for this exercise. Keep the editable PSD. Compare a smaller resolution at the effect’s actual screen size before choosing the final size. Check PNG file size separately from memory used by the imported Unity texture.

2. Build the mask-and-color material

A Material holds appearance settings such as the image, color and transparency. Shader Graph builds the calculations by connecting nodes. Here the grayscale image supplies the shape and Tint supplies the color. Unlit displays that color without directional-light shading.

  1. Right-click in Project and choose Create → Shader Graph → URP → Unlit Shader Graph. Name it SG_LightGather and double-click to open it. Set Transparent surface, Additive blending and Alpha Clipping off.
    RGB / 8 bit
    RGB / 8 bit
  2. In the Blackboard, use + to add Texture2D MaskTex, Color Tint and Float Intensity and Opacity. Enable Exposed for each so it appears in the Material Inspector. MaskTex chooses the image, Tint chooses its color, Intensity multiplies brightness and Opacity multiplies transparency. Set the default Tint to white with alpha one and both floats to one; verify them on the material too.
    Expose Texture2D MaskTex · Color Tint · Float
    Expose Texture2D MaskTex · Color Tint · Float
  3. Right-click empty graph space to add nodes, the small calculation blocks. Connect MaskTex to the Texture input of Sample Texture 2D. Use Multiply nodes to multiply sample R, Vertex Color A and Opacity, then pass the result through Saturate into Fragment Alpha. Multiply performs multiplication; Saturate limits the result to 0–1. Feed Tint RGB × Vertex Color RGB × Intensity into Base Color.
    Connect image brightness to opacity: black disappears
    Connect image brightness to opacity: black disappears
  4. Create M_LightGather from the saved graph, assign its PNG to MaskTex and set Tint to pale gold. Save the Material here. Assign it to the Gather Renderer after creating that object in the later steps. Renderer is the component that draws the object on screen.
    Connect image brightness to opacity: black disappears
    Connect image brightness to opacity: black disappears

Vertex Color passes the particle or line color and Alpha into the material. Multiplying its A makes settings such as Color over Lifetime visibly fade the result. For Particle System, open Renderer and check that Custom Vertex Streams includes Color and supplies the expected UV coordinates, which choose where the image is sampled.

See the Shader Graph walkthrough and mask workflow for node and export details.

Additively blend dot and flash masks, fading them through alpha.
Additively blend dot and flash masks, fading them through alpha.

3. Assemble Gather

Select EF_Light in Hierarchy and choose GameObject → Effects → Particle System. Name it Gather. If it is not indented under EF_Light, drag Gather onto EF_Light. Keep Gather selected and enter the table values in Inspector. Tick a module to enable it, then open its heading to edit its fields.

SettingValuePurpose / check
Main / Duration; Looping1 s; OffA single gathering event.
Main / Lifetime; Speed; Size0.5 s; 0; 0.05–0.08Remove outward launch speed before adding inward velocity.
Main / Gravity Modifier; Space0; LocalGather relative to the effect origin.
Emission / Rate; Burst0; time 0, count 20Spawn together on the outer shell.
Shape / Shape; Radius; Radius ThicknessSphere; 0.7; 0Begin on the sphere surface.
Velocity over Lifetime / Space; Linear XYZLocal; (0, 0, 0)Avoid an unwanted linear velocity.
Velocity over Lifetime / Radial-1.2A negative value moves inward.
Renderer / Mode; MaterialBillboard; M_LightGatherInspect the gathering dots first.
Gather around a raised parent, then delay Flash.
Gather around a raised parent, then delay Flash.
Fade before the particles pass through the center
Fade before the particles pass through the center

4. End the gather before overshoot

Gather starts at radius 0.7 and moves inward at speed 1.2. During its 0.5-second lifetime it travels about 0.6, leaving roughly 0.1 before the center. Let it fade there rather than keeping it alive long enough to pass through the center.

Keep lifetime RGB white with alpha keys (0,0), (0.1,0.8), (0.8,0.8), (1,0). Keep size constant initially and inspect inward motion from side and angled views.

Fade before the particles pass through the center
Fade before the particles pass through the center

5. Add Flash after the gathering phase

  1. Duplicate the soft-dot mask or paint a white central disc and narrow cross on black as Mask_Flash, leaving black margins.
    Black margins become transparent
    Black margins become transparent
  2. Duplicate the material as M_Flash and replace its mask. Begin near white at intensity one; compare two to four only after the shape reads.
    Replace the dot with a circle-and-cross image
    Replace the dot with a circle-and-cross image
  3. Create Flash as a separate system: looping off, duration one second, delay 0.5 s, lifetime 0.25 s, speed zero, size 1.2 and gravity zero.
    Time since playback started →
    Time since playback started →
  4. Disable Shape; use rate zero and a one-particle burst at zero. Render a billboard with M_Flash and alpha keys (0,0), (0.08,1), (1,0). Verify one flash after gathering.
    Most visible
    Most visible

Flash’s Alpha-curve position 0.08 is a fraction of its lifetime. With lifetime 0.25 seconds, its peak is at 0.25 × 0.08 = 0.02 seconds after the Flash appears. Start Delay 0.5 seconds is the wait from entering Play until Flash begins; it uses a different starting point.

Gather is centered on EF_Light. After resetting, set the parent position to (0,1,0) and both child local positions to zero. This keeps the radius-0.7 sphere above the floor at Y=0.

Gather convergence and Flash alpha use different time origins. Flash alpha peaks 0.02 seconds after birth, near global time 0.52 seconds.
Gather convergence and Flash alpha use different time origins. Flash alpha peaks 0.02 seconds after birth, near global time 0.52 seconds.

6. Add brightness after the timing reads

Compare Gather only, Flash only and both. If both phases are equally white, reduce gathering intensity and reserve the peak. Any additional ring should be a separate weaker, longer-lived layer.

For HDR/bloom use the Bloom checklist, changing intensity and threshold separately. Bright shader output and lighting surroundings are different operations.

Fade before the particles pass through the center
Fade before the particles pass through the center

Check the center and particle counts

Radius Thickness zero emits from the sphere surface; one also uses its volume. Keep zero here, with orbital offsets (0,0,0) and speed modifier one for a clear baseline.

Start caps at 24 for Gather and four for Flash. Verify rate zero and burst one on Flash; check alpha/lifetime integration before increasing intensity.

From the first playback to saving

Disable Flash and check that Gather remains above the floor and converges before the center. Restore Flash and inspect one pulse after gathering.

Disable Flash and verify Gather moves inward. Re-enable Flash and restart to compare the handoff at about 0.5 s. Do not offset the timing by enabling layers partway through this baseline test.

Inspector values tested in Play may reset when you stop. Write down the values you want to keep, exit Play and enter them again, then save the Scene. Drag the completed root object into Project to save a Prefab, a reusable file containing the whole effect.

Troubleshoot one cause at a time

SymptomFirst checkComparison
Dots move outwardRadial and initial speedCompare Gather alone with speed zero and radial -1.2.
Oscillation at centerLifetime and travel distanceEnd particles before overshoot and hand off to Flash.
Flash appears immediatelyFlash system delayDelay Flash itself by 0.5 seconds.

Completion checks: compare under matching conditions

  1. Verify distinct gathering/flash stages without bloom.
    Check gathering and the brief flash as separate phases
    Check gathering and the brief flash as separate phases
  2. Check onset at zero and 0.5 seconds respectively.
    Emit Flash once, 0.5 seconds after the system starts
    Emit Flash once, 0.5 seconds after the system starts
  3. Compare core contrast on white, gray and black.
    Check gathering and the brief flash as separate phases
    Check gathering and the brief flash as separate phases
  4. Check that the peak timing remains readable at small screen size.
    Emit Flash once, 0.5 seconds after the system starts
    Emit Flash once, 0.5 seconds after the system starts

Continue by comparing another element

Return to the eight-element comparison to compare shape, motion and persistence. Another exercise is the darkness recipe.

References