Game particle effects in VS Code with GitHub Copilot
Add the ParticleFX MCP server to VS Code for GitHub Copilot agent mode, then have it build an explosion and export a grid spritesheet that a short Unity script plays.
GitHub Copilot's agent mode in VS Code can use MCP tools alongside its own. Connect the ParticleFX server and Copilot can make the effect your Unity scene needs, check its renders, and put the sheet and its data next to your scripts.
Connect VS Code
- Sign in at particlefx.studio and make an API key on your billing page. Any account can, the free one included. The key starts with
pfx_live_, is shown once, and can be revoked there at any time. - Create
.vscode/mcp.jsonin your project with the server below. Theinputsentry makes VS Code ask for the key when the server starts, so the key is not written in the file and the file can be committed. - Run MCP: List Servers from the Command Palette, start particlefx, and enter the key when VS Code asks for it.
- Pick Agent in the Chat view and open Configure Tools: the ParticleFX tools should be listed.
{
"inputs": [
{ "type": "promptString", "id": "pfx-api-key", "description": "ParticleFX API key", "password": true }
],
"servers": {
"particlefx": {
"type": "http",
"url": "https://mcp.particlefx.studio/mcp",
"headers": { "Authorization": "Bearer ${input:pfx-api-key}" }
}
}
}VS Code can also sign in with your account instead: leave out headers and inputs, and VS Code registers itself with our server and opens particlefx.studio to sign in when the server first starts. On a Copilot Business or Enterprise seat, the MCP servers in Copilot policy has to be enabled for your organisation.
Example: an explosion for Unity
Use the particlefx tools. Start from the Big Explosion library effect, name it
big-explosion, make it a little shorter and punchier, check the render, then export a
spritesheet with grid JSON, transparent, 30 fps, into Assets/FX/. Write a SheetFx
component that plays it from the JSON.What happens, tool by tool:
list_presetsfinds Big Explosion (pixel-arcade/bigExplosion) in the library.create_effectcopies it into your account asbig-explosion. From here on it is your effect: it shows up on My effects andopen_in_studiogives a link to it.edit_effectapplies the change you asked for as edit ops, the same edit language the studio and its own agent use.render_previewreturns a labelled contact sheet of moments across the loop. Copilot looks at it, and edits again if something reads badly.analyze_effectchecks that the loop closes and counts particles over it.export_effectwithformat: "sheet",sheet_meta: "grid",transparent: trueandfps: 30renders the real thing at full size and returns a download link that works for 1 hour.- Copilot downloads the zip and unpacks it into
Assets/FX/:big-explosion.pngandbig-explosion.json.
The grid JSON gives the frame size, the fps and frameOrder, the top-left corner of each frame in play order (identical frames are stored once, so this is the reliable order). Unity imports the JSON as a TextAsset, so a short component can build the frames from it:
using UnityEngine;
[RequireComponent(typeof(SpriteRenderer))]
public class SheetFx : MonoBehaviour
{
public Texture2D sheet; // big-explosion.png
public TextAsset grid; // big-explosion.json
public float pixelsPerUnit = 100f;
public bool loop;
[System.Serializable] class Cell { public int x, y; }
[System.Serializable] class Grid { public int frameWidth, frameHeight; public float fps; public Cell[] frameOrder; }
Sprite[] frames;
float fps, t;
SpriteRenderer sr;
void Awake()
{
var g = JsonUtility.FromJson<Grid>(grid.text);
fps = g.fps;
frames = new Sprite[g.frameOrder.Length];
for (int i = 0; i < frames.Length; i++)
{
var c = g.frameOrder[i];
// The JSON counts y from the top; Unity counts from the bottom.
var rect = new Rect(c.x, sheet.height - c.y - g.frameHeight, g.frameWidth, g.frameHeight);
frames[i] = Sprite.Create(sheet, rect, new Vector2(0.5f, 0.5f), pixelsPerUnit);
}
sr = GetComponent<SpriteRenderer>();
}
void Update()
{
t += Time.deltaTime;
int i = (int)(t * fps);
if (i >= frames.Length)
{
if (!loop) { Destroy(gameObject); return; }
t = 0f;
i = 0;
}
sr.sprite = frames[i];
}
}- Import settings: set the PNG's Texture Type to Sprite (2D and UI) so Unity keeps its exact size, and raise Max Size to at least the sheet's longest side (this one is 2688 x 1456, so 4096); a downscaled sheet puts every frame in the wrong place. For pixel art also set Filter Mode to Point and Compression to None.
- Without a script: slice the PNG in the Sprite Editor with Grid By Cell Size, using
frameWidthandframeHeightfrom the JSON. The Unity engine guide walks through it. - Glow: export with
transparent: falseandblack_background: true, and use an additive material.
What it costs
Connecting costs nothing, and neither do searching the library, reading the reference, analysing an effect, or any edit after the first. Paid steps use builds, the same builds as on the website:
- Create the effect from a library preset (
create_effect): 1 build. - Edits and the loop check (
edit_effect,analyze_effect): free. - Previews (
render_preview): the first 20 of each UTC day free, then 1 build per 4, at most 200 a day. - Export (
export_effect, grid sheet with JSON): 1 build, and the grid JSON needs a paid plan.
So this example takes 2 builds of work if the previews stay inside the free ones: 1 for the new effect and 1 for the export. The free sign-up and daily builds are for the website and never pay for MCP calls. On a free account and on Starter, MCP calls are paid from pack builds, from $4.99 for 150 that never expire. Creator at +50%, Studio at +25%, Studio Max one for one can spend plan builds instead, and fall back to pack builds when those run out. Work that fails on our side is refunded.
The grid JSON is a plan feature, as in the studio: any plan, from $7.99 a month (Starter), unlocks it. Without a plan the same build exports a GIF, WebP, APNG, PNG frames, or the sheet as an image only (sheet_meta: "none").
If you would rather our own effects agent did the creative work, build_effect takes a description and costs 1 build (Basic) or 10 (Pro). Full price list: MCP tools and keys, limits and billing.
Next
Every tool and its parameters are in the tools reference. Setup for the other clients is on Coding agents, and any of the free effects can be the starting point for Copilot.
Questions
Which Copilot mode can use the ParticleFX tools?
Agent mode. MCP tools appear in the tools list of the Chat view when it is set to Agent.
Where should the VS Code MCP config live?
In .vscode/mcp.json for one project, which you can commit when the key comes from an input, or in your user mcp.json (MCP: Open User Configuration) for every workspace.
Why does the Unity script use frameOrder instead of slicing in order?
Identical frames are stored once in the sheet, so the number of cells can be smaller than the number of frames. frameOrder lists the cell for every frame in play order, so the timing is always right.
Can I use the effects in a commercial game?
Yes. Exported effects, including ones started from the library or changed by your agent, may be used in any project, commercial games included, with no credit required. Reselling the library itself as an effect pack is not allowed.
