gameobject-set-parent

Reparent GameObjects under a new parent in Unity Prefabs or Scenes.

Updated May 20, 2026
One-click install
npx skills add https://github.com/Alltwice/Unity-3D-Project --skill gameobject-set-parent-alltwice
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gameobject-set-parent
Source: https://github.com/Alltwice/Unity-3D-Project/tree/main/.agents/skills/gameobject-set-parent
Command: npx skills add https://github.com/Alltwice/Unity-3D-Project --skill gameobject-set-parent-alltwice

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Reorganizing GameObject hierarchies in Unity one object at a time is slow and error-prone, especially when restructuring large Prefabs or Scenes. This Skill reparents a batch of GameObjects under a new parent in a single call, reporting per-item failures without aborting the whole batch. ## Core Features & Use Cases - Batch Reparenting: Moves a list of GameObjects under a new parent in the currently opened Prefab or active Scene. - World Position Preservation: The worldPositionStays flag controls whether each GameObject keeps its world-space transform when reparented via Transform.SetParent. - Fault-Tolerant Status Reporting: Per-item resolve errors are appended to the returned status string instead of throwing, and the scene is marked dirty with editor windows repainted after success. - Use Case: After locating a group of UI elements with the 'gameobject-find' tool, reparent them all under a new container GameObject while preserving their world positions. ## Quick Start Ask the AI to reparent the GameObjects found with gameobject-find under a new parent GameObject in the active Unity scene while keeping their world positions unchanged.

Frequently Asked Questions about gameobject-set-parent

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reparent multiple GameObjects in Unity at once?▼

Call the gameobject-set-parent tool with a list of gameObjectRefs and a parentGameObjectRef. Each GameObject is reparented independently, and per-item resolve errors are appended to the returned status string instead of aborting the batch.

How to set a GameObject parent without changing its world position in Unity?▼

Set the worldPositionStays parameter to true, which is the default. This value is passed to Transform.SetParent so each GameObject preserves its world-space transform when moved under the new parent.

Does gameobject-set-parent work in Prefabs and Scenes?▼

Yes, it operates on GameObjects in the currently opened Prefab or in the active Scene. After at least one successful reparent, it marks the active scene dirty and repaints editor windows.

Why does gameobject-set-parent return an error for the parent reference?▼

The parentGameObjectRef must resolve to a valid GameObject; otherwise the call returns early with an error string. Use the gameobject-find tool first to locate valid GameObject references by instanceID, path, or name.

What happens if some GameObjects fail to reparent?▼

Failures are handled per item: resolve errors are appended to the returned status string rather than throwing an exception. The remaining GameObjects still get reparented, and the scene is marked dirty if at least one succeeded.