/funplay-skill:unity-mcp-workflowfrom funplay-skill
Edits, imports, compiles, inspects, and tests Unity projects via Funplay MCP. Provides structured workflows for prefab editing, scene manipulation, Play Mode validation, and console error reporting.
Ships in funplay-skill. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use this skill when an agent is working in a Unity project connected to Funplay MCP for Unity and needs to verify code, prefabs, UI, Play Mode behavior, screenshots, scene hierarchy, console logs, domain reloads, or MCP connection issues.
This tracks the default project workflow skill shipped by FunplayAI/funplay-unity-mcp.
PrefabUtility.LoadPrefabContents, PrefabUtility.SaveAsPrefabAsset, and PrefabUtility.UnloadPrefabContents.execute_code batch over many fragile UI clicks.request_recompile, then wait_for_compilation, then inspect console or compilation errors.{success, message, data} for success and {success: false, code, error, data} for errors.code values such as OBJECT_NOT_FOUND instead of matching free-form text.instanceId, componentInstanceId, and fileID values returned by tools for follow-up calls. Treat them as strings because newer Unity versions may return EntityId text instead of numeric InstanceIDs.find_method=by_id when available. Auto-detect usually treats integers as IDs, slashed strings as paths, and other strings as names, but explicit find_method is clearer when the target matters.component_instance_id.get_editor_state, get_selection, set_selection, get_prefab_stage, get_tags, get_layers, and get_build_settings.find_game_objects, list_components, get_component_properties, set_component_property, and set_component_properties for object/component work when exposed.set_component_property and set_component_properties write through SerializedObject, so [SerializeField] private fields are reachable. Pass object references as {"fileID": "<instanceId>"} or {"assetPath": "Assets/..."}.execute_menu_item before falling back to ad-hoc execute_code.core profile, rely on focused workflow tools: execute_code, recompilation, Play Mode control, hierarchy, console logs, screenshots, input simulation, performance inspection, editor state reads, object/component inspection, component setters, and execute_menu_item.full profile, prefer specific MCP tools for simple scene, asset, GameObject, component, prefab, camera, UI, package, animation, file, or visual-feedback operations.Prefer native MCP tools when the client exposes them directly. If native tools are hidden or stale, probe the local HTTP endpoint:
curl -sS -m 1 -X POST http://127.0.0.1:8765/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
For multi-line execute_code calls over curl, generate JSON with a real encoder instead of hand-escaping C#.
Prefer the IFunplayCommand template for new snippets so object creation, modification, deletion, and logging flow through the MCP execution context:
node - <<'NODE'
const code = String.raw`
using UnityEngine;
using Funplay.Editor.Tools.Scripting;
public class InspectSomething : IFunplayCommand
{
public string Execute(ExecutionContext ctx)
{
var obj = GameObject.Find("PracticeInGameUiRoot");
if (obj != null)
{
ctx.RegisterObjectModification(obj, "Inspect UI root");
ctx.Log("Found " + obj.name);
}
return obj != null ? obj.name : "not found";
}
}
`;
const payload = {
jsonrpc: "2.0",
id: 1,
method: "tools/call",
params: { name: "execute_code", arguments: { code } }
};
process.stdout.write(JSON.stringify(payload));
NODE
Use fully qualified types if the snippet environment or injected project code makes using statements unreliable:
var root = UnityEngine.GameObject.Find("PracticeInGameUiRoot");
var rect = root.GetComponent<UnityEngine.RectTransform>();
Use Unity null semantics for UnityEngine.Object references:
if (image == null)
{
return "Image missing";
}
For prefab edits:
var path = "Assets/MyGame/UI/Prefabs/PF_PracticeInGameUiRoot.prefab";
var prefab = UnityEditor.PrefabUtility.LoadPrefabContents(path);
try
{
var target = prefab.transform.Find("SafeArea/SwingCancelZone");
if (target == null)
{
return "SwingCancelZone not found in prefab";
}
var rect = target.GetComponent<UnityEngine.RectTransform>();
var before = rect.anchoredPosition;
rect.anchoredPosition = new UnityEngine.Vector2(-76f, 448f);
UnityEditor.EditorUtility.SetDirty(rect);
UnityEditor.PrefabUtility.SaveAsPrefabAsset(prefab, path);
UnityEditor.AssetDatabase.SaveAssets();
return "Prefab saved: pos " + before + " -> " + rect.anchoredPosition;
}
finally
{
UnityEditor.PrefabUtility.UnloadPrefabContents(prefab);
}
For scene edits:
var obj = UnityEngine.GameObject.Find("PracticeInGameUiRoot/SafeArea/SwingCancelZone");
if (obj == null)
{
return "Scene object not found";
}
var rect = obj.GetComponent<UnityEngine.RectTransform>();
var before = rect.sizeDelta;
UnityEditor.Undo.RecordObject(rect, "Update cancel zone");
rect.sizeDelta = new UnityEngine.Vector2(220f, 116f);
UnityEditor.EditorUtility.SetDirty(rect);
UnityEditor.SceneManagement.EditorSceneManager.MarkSceneDirty(obj.scene);
UnityEditor.SceneManagement.EditorSceneManager.SaveScene(obj.scene);
return "Scene saved: size " + before + " -> " + rect.sizeDelta;
After external C# or asset file edits:
exit_play_mode first. request_recompile is rejected during play because Unity does not run script compilation or domain reloads while playing.request_recompile for tools that depend on freshly compiled code.wait_for_compilation.get_reload_recovery_status when available, re-scan the MCP endpoint if needed, then continue from wait_for_compilation.Do not treat a disconnected request as a successful compile.
execute_code refreshes the asset database and waits for compilation before compiling the snippet, so it usually picks up external file edits automatically. Other tools that depend on current assemblies still need the explicit recompile path above.
After enter_play_mode, the HTTP server is briefly unreachable while Unity reloads the domain. Before issuing the next tool call, poll a cheap endpoint such as tools/list or get_reload_recovery_status until you get a response.
Use readback snippets that print exact values, not only success:
var all = UnityEngine.Resources.FindObjectsOfTypeAll<UnityEngine.Transform>();
UnityEngine.Transform target = null;
for (int i = 0; i < all.Length; i++)
{
if (all[i].name == "SwingCancelZone")
{
target = all[i];
break;
}
}
if (target == null)
{
return "SwingCancelZone not found";
}
var rect = target.GetComponent<UnityEngine.RectTransform>();
return "path=" + target.name + "; pos=" + rect.anchoredPosition + "; size=" + rect.sizeDelta;
For UI work, verify prefab or scene hierarchy, sprite references, anchors, sorting order, active state, text fit, and button listeners. A populated Content hierarchy does not prove the user can see the UI.
For gameplay or network work, verify object identity, ownership, live instance existence, transform values, animation state, visibility, and whether client-side filters are discarding valid data.
FunplayAI/funplay-unity-mcp3ef233a8a86eb03a281873b778d79bbfb1e3e899What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Claude Code refuses to install this plugin
.claude-plugin/plugin.json: agents: Invalid string: must end with ".md"
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
14 skills in this plugin
/audio-format-convertConvert audio files between WAV, OGG, and MP3 with ffmpeg./canvas-page-popup-bootstrapSafely create or inspect new Cocos page, popup, or HUD canvas entries with canonical entry paths, parent and flow wiring, and authored-source guardrails./canvas-page-popup-removalCheck blockers and safely remove existing Cocos page or popup canvas nodes without silently deleting prefab, script, or runtime assets./cocos-ui-node-retrofitClassify and plan safe Cocos UI node retrofits such as text changes, SpriteFrame swaps, or converting a label-only control into an image-backed button with overlay text./commercial-unity-gameUse this when designing, building, or auditing a commercial-grade Unity mobile/F2P game beyond prototype scope, including architecture, save data, data-driven content, economy, IAP/shop, retention, asset/audio pipelines, analytics, remote config, and Funplay Unity MCP verification./game-concept-briefTurn an early game idea or creative inspiration into a compact GDD-lite concept brief with creative north star, MDA framing, MVP scope, and first-playable acceptance criteria before implementation.Other plugins' skills for the same job