Skip to content

How to Make a Sword Slash, Weapon Trail and Hit Effect in Unity

A sword slash is usually one short lived particle: a curved strip of mesh, or a crescent texture, whose texture scrolls along the swing and fades out within a fraction of a second. A trail follows the blade or the projectile. A hit is a burst at the point of contact: a flash, sparks and often a ring.

Three effects from the All In 1 VFX Toolkit demo side by side: an orange sword slash sweeping its arc and leaving smoke and embers, a fire trail circling, and a fire impact bursting into a flash and sparks
  • The shape. An arc mesh, a flat strip bent into the swing, drawn by a Particle System in Mesh mode, one particle per swing. Or a camera facing quad with a crescent texture, which is simpler and only looks right from the front. The swing’s angle is the arc’s own, so an 80 degree swing needs an 80 degree arc, then rotated to match the blade.
  • The texture. A streak along the arc, brightest at the leading edge, on an additive material so it glows over whatever is behind it.
  • Over its life. The texture scrolls along the arc as the particle lives, so the streak sweeps through, and the slash fades out at the end. A slight growth in size helps it feel fast.
  • Layers. A good slash is several particles at once: a bright core, a darker smoke behind it, sparks flying off. The demo’s orange slash has five.

The slash is a Particle System with one particle:

  • Emission: a single burst at time 0. Start Lifetime around 0.3 seconds.
  • Renderer: Render Mode Mesh, with your arc as the mesh. 3D Start Rotation aims it.
  • Scrolling: a Custom Data module with a curve from 0 to 1 over the particle’s life, and that value added to the particle’s Custom Vertex Streams in the Renderer module, so the shader receives it. The shader then adds it to the texture’s offset. URP’s own particle shaders do not read custom streams for that, so this part needs a shader of your own or a Shader Graph.

The trail is a Trail Renderer on the blade or the projectile: a short Time, a width curve that narrows towards the end, and a colour gradient that fades out. For trails behind many particles, the Particle System’s Trails module does the same per particle.

The hit is another Particle System with a single burst: stretched sparks flying out, one large flash that lives a few frames, and a ring that grows and fades.

What it costs: every layer is its own Particle System and its own draw, the scrolling needs custom shader work, and getting a slash to read as fast and heavy is mostly iteration on textures and timing.

Don’t own it yet? → Get it on the Unity Asset Store

The demo’s prefabs are ready to use or to take apart, in Demo & Assets/Demo/Prefabs:

  • Slashes: Slash Orange, Slash Blue, Slash Magic and Slash Venom.
  • Trails: Fire Trail, Ghost Trail and Pink Trail.
  • Projectiles, each with its muzzle flash and impact: Gun, Fire, Ice and Digital.
  • Impacts: Gun, Fire, Ice and Digital Proj Impact, plus Blue, Red and Purple Impact.

The pieces they are made of ship too: arc meshes from Slash to Slash8 and Arc1, spell meshes from CastSpell10Deg to CastSpell360Deg, and textures for slash cores, trails, trail heads, impacts, flares and rings. See Premade Textures, Meshes and Materials.

The swing angle is the arc mesh’s own, so a narrower or wider swing means a different mesh in the slash’s Particle System renderer: another of the Slash meshes, or one you model at the angle you need.

Scrolling over the particle’s life is the Texture Offset Custom Stream option: each shape reads the particle’s Custom Data and scrolls by it. The Custom Data Auto Setup button on the Particle System Helper component sets up the Custom Data curves and the vertex streams for you. See Custom Vertex Streams and Custom Data Auto Setup and Particle System Helper Component.

One particle with Custom2.x at 0 and its texture still, and with Custom2.x going from 0 to 1 and its texture scrolling across the particle over its life

Trail Width shapes a Trail Renderer’s width along its length from the material: a gradient where white is full width and black is none, and a Power to sharpen it. Keep the Trail Renderer’s own width constant and let the material do the shaping. The gradient is stored as a texture, so save the material as an asset first.

Fading out is Fade From Noise Texture or Fade From Final Shape, driven by the particle’s alpha or by its Custom Data. Every property is on Effects and Properties Breakdown.

The demo’s projectiles show the usual setup: a bullet or a glowing head with Trail Renderers behind it, a muzzle flash where it is fired, and an impact prefab spawned where it lands.

To keep them cheap, on mobile above all:

  • Fewer layers. Each Particle System and each Trail Renderer is a draw. A projectile with four trails costs four times one.
  • Fewer material variants. Materials that use different effects are different shader variants and do not batch together. In URP, the SRP Batch variant of the shader works with the SRP Batcher. See ECS and SRP Batcher.
  • Less overdraw. Big additive flashes covering the screen are the costly part of an impact; Alpha Cutoff trims the transparent edges that cost without showing.
  • Screen Distortion is the most expensive effect, so keep it for the hits that matter.
  • A directional dissolve. The fades have no direction setting. A dissolve that sweeps one way comes from the fade texture itself: a linear gradient fades from its dark side first.
  • A swing angle slider. The angle comes from the arc mesh.
  • GPU instancing of mesh particles. The Particle System’s instanced mesh mode needs shader support these shaders do not have.