assets-prefab-create

Solid

Create a Prefab (or Prefab Variant) at a project asset path. Source can be a scene GameObject (`gameObjectRef`) or an existing prefab asset (`sourcePrefabAssetPath`). Creates intermediate folders if missing. Use 'gameobject-find' to locate the source GameObject first.

AI & Automation 2,976 stars 277 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 93/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Assets / Prefab / Create Create a prefab from a GameObject in the current active scene. The prefab will be saved in the project assets at the specified path. Creates folders recursively if they do not exist. If the source GameObject is already a prefab instance and 'connectGameObjectToPrefab' is true, a Prefab Variant is created automatically. To create a Prefab Variant from an existing prefab asset, provide 'sourcePrefabAssetPath' instead of 'gameObjectRef'. Use 'gameobject-find' tool to find the target GameObject first. ## Inputs (mutually exclusive sources) - `prefabAssetPath` — required. Must start with `Assets/` and end with `.prefab`. - `gameObjectRef` — scene GameObject to convert (or to seed a Prefab Variant from when it is already a prefab instance). - `sourcePrefabAssetPath` — existing prefab asset to seed a Prefab Variant from. Cannot be combined with `gameObjectRef`. - `connectGameObjectToPrefab` (default `true`) — when sourcing from a scene GameObject, connect the scene object to the new prefab asset (becoming a prefab instance). Ignored for `sourcePrefabAssetPath` (always creates a variant). ## Behavior Creates intermediate folders along `prefabAssetPath` if they don't already exist. Returns an `AssetObjectRef` pointing at the new prefab asset. ## How to Call ```bash unity-mcp-cli run-tool assets-prefab-create --input '{ "prefabAssetPath": "string_value", "gameObjectRef": "string_value", "sourcePrefabAssetPath": "string_value", "connectGameObjec...

Details

Author
IvanMurzak
Repository
IvanMurzak/Unity-MCP
Created
1 years ago
Last Updated
today
Language
C#
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category