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

Back to the elemental comparison and recipes

What you will build

Launch angular rocks from the ground, let them fall onto a floor, and leave a light dust cloud afterward. Rocks is a Particle System that emits rock meshes; Dust emits flat cloud images. Gravity and floor collision control the rocks. Dust starts slightly later and fades slowly. Complete the rock motion before adding the dust.

Rocks launches meshes that fall onto the floor. Dust starts after a 0.08-second delay. Start Delay controls dust timing; Rocks Collision controls floor contact.
Rocks launches meshes that fall onto the floor. Dust starts after a 0.08-second delay. Start Delay controls dust timing; Rocks Collision controls floor contact.

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_Earth. In Inspector, open the Transform menu and choose Reset to restore its position, rotation and scale. 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 Rocks, then floor collision, then Dust. Check each part on its own before adding the next part.

Object relationships

EF_Earth 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_Earth
  Rocks
  Dust
Ground (Box Collider; outside EF_Earth)

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.

Make flying rocks and dust that lingers after contact with the floor.
Make flying rocks and dust that lingers after contact with the floor.

1. Make a small low-poly rock mesh

  1. In Blender 4.5 add an Icosphere with Subdivisions one and Radius 0.5. Use flat shading for faceted lighting.
    Shade Flat
    Shade Flat
  2. Move a few vertices slightly in Edit Mode to make an irregular chunk without long needle-like protrusions.
    Keep a compact angular shape
    Keep a compact angular shape
  3. Name it RockLow, apply rotation/scale on an export copy, export FBX and compare its imported size with a unit cube.
    Rotation / Scale
    Rotation / Scale
  4. Create M_Rock using URP Particles/Lit, Opaque surface, gray-brown color, Metallic zero and Smoothness 0.1.
    Metallic 0 / Smoothness 0.1
    Metallic 0 / Smoothness 0.1

A mesh is a 3D shape made of vertices and faces. Leave out fine textures here: angular edges and lit facets make the rock readable. The Rocks Particle System emits this mesh as particles.

2. Assemble Rocks

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

SettingValuePurpose / check
Transform / Position; Rotation(0, 0.1, 0); (-90, 0, 0) degLaunch upward from the ground.
Main / Duration; Looping1.5 s; OffA single eruption.
Main / Lifetime; Speed; Size1.3 s; 3–4; 0.15–0.25Account for the original mesh dimensions.
Main / Gravity Modifier; Space1; WorldFall under gravity.
Main / Start ColorWhiteUse the material color as the baseline.
Emission / Rate; Burst0; time 0, count 8Use a small number of large chunks.
Shape / Shape; Angle; RadiusCone; 45 deg; 0.15Allow a modest spread.
Renderer / Mode; Mesh; MaterialMesh; RockLow; M_RockSelect the mesh inside the imported FBX.

Randomize initial orientation, but postpone spinning animation until launch/fall works.

Rock collision detects the floor; separate dust particles appear later.
Rock collision detects the floor; separate dust particles appear later.
Separate rock collision from delayed dust
Separate rock collision from delayed dust

3. Add floor collision

  1. Reuse the preparation floor cube as Ground. Verify position (0,-0.05,0), scale (4,0.1,4), top Y=0 and an enabled BoxCollider; do not add a duplicate floor.
    Separate rock collision from delayed dust
    Separate rock collision from delayed dust
  2. Enable particle Collision with World type and 3D mode and include the floor layer in Collides With.
    Separate rock collision from delayed dust
    Separate rock collision from delayed dust
  3. Start with Dampen 0.6, Bounce 0.1, Lifetime Loss zero and High quality. Check that rocks lose energy rather than bounce indefinitely.
    Separate rock collision from delayed dust
    Separate rock collision from delayed dust

Particle collision approximations may not exactly match the irregular mesh. Inspect sinking/floating and adjust radius scale or mesh size independently.

4. Prepare a grayscale mask

Mask_Dust 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. Paint three or four overlapping soft white discs near the center to form an irregular cloud.
    Keep black margins
    Keep black margins
  3. Leave at least 32 pixels of black margin and preserve a broad cloud instead of a white rectangle or fine dots.
    Connect image brightness to opacity: black disappears
    Connect image brightness to opacity: black disappears
  4. Export Mask_Dust.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.

5. 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_Dust and double-click to open it. Set Transparent surface, Alpha 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_Dust from the saved graph, assign its PNG to MaskTex and set Tint to gray-brown. Save the Material here. Assign it to the Dust 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.

Use opaque rocks and transparent dust with separate materials/renderers.
Use opaque rocks and transparent dust with separate materials/renderers.

6. Delay and retain the dust

Create Dust as another child: looping off, delay 0.08 s, lifetime 1.2–1.6 s, speed 0.15–0.35, size 0.4–0.7, gravity zero and world space. Use rate zero with a 16-particle burst at zero.

Use a sphere shape of radius 0.2, billboard rendering, M_Dust and initial material opacity 0.25. Grow size from 0.4 to 1.5; use alpha keys (0,0), (0.15,0.5), (1,0). Rocks should move first and the thin cloud linger.

Reduce opacity or population if dust hides the rocks. Add small-scale noise only after the main layers read clearly.

If rocks pass through the floor, select Rocks and check that Collision → Collides With includes the floor layer. Then select Ground and confirm that Box Collider, its box-shaped collision surface, is enabled.

Emit eight rocks at the start and sixteen dust particles 0.08 seconds later. Set the dust offset with Start Delay.
Emit eight rocks at the start and sixteen dust particles 0.08 seconds later. Set the dust offset with Start Delay.
Separate rock collision from delayed dust
Separate rock collision from delayed dust

Separate rock collision from dust rendering

Dampen is the fraction of speed lost at a collision. A value of 0.6 does not mean retaining 0.6 of the speed. Bounce controls rebound, and Lifetime Loss controls how much remaining lifetime is lost. Change Dampen first, then Bounce, so their effects are easy to identify.

Start caps at sixteen for Rocks and 24 for Dust. Keep the rock Particles/Lit material separate from the dust alpha graph; do not change the opaque rock material just to fade dust.

Expand the FBX/OBJ in Project and select its Mesh for the particle Renderer. Mesh particles require Read/Write; Unity enables it on assignment, but inspect Model Import Settings if an import error occurs.

From the first playback to saving

Disable Dust and verify that rocks meet the floor with a small rebound. Then inspect Dust alone for slower expansion and fading.

Disable Dust and verify launch, fall and floor collision first. Re-enable Dust and restart. If rocks intersect the floor at birth, inspect collision radius and spawn height Y=0.1 separately.

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
Rocks pass through floorCollider and collision maskCheck collider, World/3D mode and layers at low speed.
Only smoke is visibleRock/dust balanceHide dust, inspect rocks, then restore it weakly.
Identical-looking rocksSize input modeUse Random Between Two Constants for Start Size.

Completion checks: compare under matching conditions

  1. Read angular chunks and falling motion without dust.
    Separate rock collision from delayed dust
    Separate rock collision from delayed dust
  2. Verify floor height and collision layers.
    Separate rock collision from delayed dust
    Separate rock collision from delayed dust
  3. Check that dust outlasts motion and eventually fades.
    Separate rock collision from delayed dust
    Separate rock collision from delayed dust
  4. Before scaling population, profile mesh cost, collision and transparent overdraw separately.
    Separate rock collision from delayed dust
    Separate rock collision from delayed dust

Continue by comparing another element

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

References