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

Back to the elemental comparison and recipes

What you will build

Make dark-purple clumps appear around a center, spiral inward, shrink and fade. A Particle System named Swirl emits small flat surfaces carrying the clump image. Test inward movement and orbiting separately before combining them. Use Alpha blending so the dark clumps can cover part of the background while remaining translucent.

Swirl’s dark clumps move inward, orbit around the Y axis and fade. Radial controls inward travel; Orbital adds the orbiting motion.
Swirl’s dark clumps move inward, orbit around the Y axis and fade. Radial controls inward travel; Orbital adds the orbiting motion.

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_DarkVortex. 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 Swirl’s inward movement, then orbiting, then color and fading. Check each part on its own before adding the next part.

Object relationships

EF_DarkVortex 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_DarkVortex
  Swirl

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.

Rotate dark particles inward toward the center, then fade them out.
Rotate dark particles inward toward the center, then fade them out.

1. Prepare a grayscale mask

Mask_DarkClump 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 an irregular soft white clump, then remove two or three areas with a smaller black brush to break its circular silhouette.
    Keep black margins
    Keep black margins
  3. Keep edges black and central coverage white/gray. Put the visible dark color in material Tint rather than confusing it with the coverage mask.
    Connect image brightness to opacity: black disappears
    Connect image brightness to opacity: black disappears
  4. Export Mask_DarkClump.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_DarkClump 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_DarkClump from the saved graph, assign its PNG to MaskTex and set Tint to dark purple. Save the Material here. Assign it to the Swirl 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.

The mask provides coverage and Tint provides dark purple; use Alpha blending.
The mask provides coverage and Tint provides dark purple; use Alpha blending.

3. Assemble Swirl

Select EF_DarkVortex in Hierarchy and choose GameObject → Effects → Particle System. Name it Swirl. If it is not indented under EF_DarkVortex, drag Swirl onto EF_DarkVortex. Keep Swirl 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, 1.2, 0); (0, 0, 0)Place the center above ground with an unrotated frame.
Main / Duration; Looping2 s; OnA continuing vortex.
Main / Lifetime; Speed; Size0.9 s; 0; 0.25–0.4Let the velocity module drive movement.
Main / Gravity Modifier; Space0; LocalNo falling; keep a common local center.
Emission / Rate; Bursts16 /s; noneContinuously emit small clumps.
Shape / Shape; Radius; Radius ThicknessSphere; 1; 0Begin near the outer shell.
Velocity over Lifetime / Space; Linear XYZLocal; (0, 0, 0)Use the parent local frame.
Velocity over Lifetime / Orbital XYZ(0, 1.5, 0)A starting value for circulation around Y.
Velocity over Lifetime / Radial-0.8Move inward.
Renderer / Mode; MaterialBillboard; M_DarkClumpUse alpha blending for dark density.
Set the Swirl center and sphere radius, then separate inward speed from orbiting.
Set the Swirl center and sphere radius, then separate inward speed from orbiting.
Radial moves inward; Orbital adds orbiting
Radial moves inward; Orbital adds orbiting

4. Separate circulation from inward motion

  1. First use zero orbital velocity and radial -0.8 only. Verify inward motion; inspect sign and initial speed if it moves out.
    Radial moves inward; Orbital adds orbiting
    Radial moves inward; Orbital adds orbiting
  2. Next set radial zero and orbital Y to 1.5; inspect circulation with unrotated parent/system transforms.
    Radial moves inward; Orbital adds orbiting
    Radial moves inward; Orbital adds orbiting
  3. Restore both and inspect a shrinking orbit. Change speed and lifetime one at a time.
    Radial moves inward; Orbital adds orbiting
    Radial moves inward; Orbital adds orbiting

Clumps start at radius 1 and move inward by about 0.8 × 0.9 = 0.72 before fading, leaving some distance to the center. Initially keep other velocity modules and Noise off so you can see this inward movement clearly.

5. Fade while preserving dark coverage

As an example start with Tint RGB (0.06,0.02,0.10) and Opacity 0.55. Keep lifetime RGB white; set alpha keys (0,0), (0.15,0.8), (0.7,0.8), (1,0) and size from one to 0.3. Shrink/fade while moving inward.

Put a gray or white object behind Swirl and enter Play. Alpha blending lets the clumps darken part of the background. Additive adds color, so adding black cannot darken it. If the outline disappears on a dark background, move Tint slightly toward purple and compare.

If a purple rim is needed, make it a separate weak layer; brightening the entire dark mass weakens its distinction from a light vortex.

Swirl local Y=1.2 allows room above the floor for a radius-one sphere and cards up to size 0.4. Do not read Orbital 1.5 as 1.5 turns/second: inspect radial-only motion before adding orbiting.

Radial changes inward distance; Orbital adds circulation. Rotation arrows are schematic. Estimated final radius is 1−0.8×0.9=0.28.
Radial changes inward distance; Orbital adds circulation. Rotation arrows are schematic. Estimated final radius is 1−0.8×0.9=0.28.
Age = seconds / NormalizedAge = lifetime progress
Age = seconds / NormalizedAge = lifetime progress

Check color values and the vortex center

Tint uses RGB values from 0 to 1. In a 0–255 color picker, approximately (15,5,26) gives a similar starting color. Keep the visible part of the mask white or gray: black R hides a region rather than painting it black.

Use a cap of 32, zero orbital offsets and speed modifier one, starting with reset parent rotation/scale. Do not interpret orbital 1.5 as a guaranteed revolutions-per-second value.

From the first playback to saving

Zero Orbital to inspect inward motion alone. Restore Y=1.5 and verify that circulation is added while particles still approach the center.

Observe one to two seconds of spawning outside, circling inward and shrinking away. If inward travel is unclear, temporarily zero orbital velocity, inspect radial movement alone and then restore circulation.

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
Black contributes nothingBlending modeReturn to Alpha and compare against a bright background.
Outward motionInitial speed and radialIsolate speed zero, orbital zero and negative radial.
A spherical smoke cloudSize and inward flowExpose flow with smaller size/lifetime before adding population.

Completion checks: compare under matching conditions

  1. Compare circulation only, inward only and both.
    Radial moves inward; Orbital adds orbiting
    Radial moves inward; Orbital adds orbiting
  2. Compare dark coverage and silhouette on white/black.
    Radial moves inward; Orbital adds orbiting
    Radial moves inward; Orbital adds orbiting
  3. Check end-of-life alpha/size for abrupt clump removal.
    Radial moves inward; Orbital adds orbiting
    Radial moves inward; Orbital adds orbiting
  4. Profile transparent overlap and sorting on the target device when scaling instances.
    Change one variable, then remeasure
    Change one variable, then remeasure

Continue by comparing another element

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

References