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.
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.
- 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 - 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 - 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 - 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
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.
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.
- 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 - 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 a white center rather than making the entire image uniformly gray; preserve broad coverage for small particles.
Connect image brightness to opacity: black disappears - 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
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.
- 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 - 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 - 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 - 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
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.
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.
| Setting | Value | Purpose / check |
|---|---|---|
| Main / Duration; Looping | 1 s; Off | A single gathering event. |
| Main / Lifetime; Speed; Size | 0.5 s; 0; 0.05–0.08 | Remove outward launch speed before adding inward velocity. |
| Main / Gravity Modifier; Space | 0; Local | Gather relative to the effect origin. |
| Emission / Rate; Burst | 0; time 0, count 20 | Spawn together on the outer shell. |
| Shape / Shape; Radius; Radius Thickness | Sphere; 0.7; 0 | Begin on the sphere surface. |
| Velocity over Lifetime / Space; Linear XYZ | Local; (0, 0, 0) | Avoid an unwanted linear velocity. |
| Velocity over Lifetime / Radial | -1.2 | A negative value moves inward. |
| Renderer / Mode; Material | Billboard; M_LightGather | Inspect the gathering dots first. |
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.
5. Add Flash after the gathering phase
- 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 - 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 - 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 → - 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
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.
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.
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
| Symptom | First check | Comparison |
|---|---|---|
| Dots move outward | Radial and initial speed | Compare Gather alone with speed zero and radial -1.2. |
| Oscillation at center | Lifetime and travel distance | End particles before overshoot and hand off to Flash. |
| Flash appears immediately | Flash system delay | Delay Flash itself by 0.5 seconds. |
Completion checks: compare under matching conditions
- Verify distinct gathering/flash stages without bloom.
Check gathering and the brief flash as separate phases - Check onset at zero and 0.5 seconds respectively.
Emit Flash once, 0.5 seconds after the system starts - Compare core contrast on white, gray and black.
Check gathering and the brief flash as separate phases - Check that the peak timing remains readable at small screen size.
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
- Unity 2022.3: Particle System Main module
- Unity 2022.3: Shape module
- Unity 2022.3: Emission and Bursts
- Unity 2022.3: Velocity over Lifetime
- Unity 2022.3: Color over Lifetime
- Unity 2022.3: Size over Lifetime
- Shader Graph 14: Sample Texture 2D
- Shader Graph 14: Vertex Color
- Unity 2022.3: Default texture settings