assets-prefab-create

Create a Unity prefab from a scene GameObject at a specified asset path.

Updated Feb 4, 2024
One-click install
npx skills add https://github.com/sprillion/gem_td --skill assets-prefab-create-sprillion
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: assets-prefab-create
Source: https://github.com/sprillion/gem_td/tree/main/SKILLS/assets-prefab-create
Command: npx skills add https://github.com/sprillion/gem_td --skill assets-prefab-create-sprillion

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Create a prefab from a GameObject in the active Unity scene.

Core Features & Use Cases

  • Convert in-scene GameObjects into reusable assets at a specified path.
  • Optionally replace the original GameObject with the new prefab in the scene.
  • Supports targeting nested or child objects for prefabization.

Quick Start

Call the tool with a prefabAssetPath and a gameObjectRef to create the prefab and save it at the specified path.

Frequently Asked Questions about assets-prefab-create

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

FAQPage Schema
How do I create a prefab from a GameObject in my Unity scene?

To create a prefab from a GameObject, you provide the target object reference and a destination asset path. The tool converts the in-scene object into a reusable prefab saved at the specified project location.

Can I replace the original GameObject in the scene after creating a prefab?

Yes, you can replace the original GameObject by enabling the replaceGameObjectWithPrefab option. This substitutes the in-scene object with the newly generated prefab instance for project-wide consistency.

What is the purpose of converting scene objects into Unity prefabs?

Converting scene objects into prefabs creates reusable assets that ensure consistency across your project. This allows you to apply updates globally to all instances of that object rather than modifying them individually.

Does this prefab creation tool support targeting nested or child objects?

Yes, the prefab creation process supports targeting nested or child objects for prefabization. You can specify a child object reference to convert specific parts of a hierarchy into standalone reusable assets.

What inputs do I need to save a GameObject as a prefab asset?

You need to provide a prefabAssetPath defining the save location and a gameObjectRef identifying the target object. These inputs enable the conversion of the active scene object into a reusable asset.

When should I avoid replacing the original GameObject with the new prefab?

You should avoid replacing the original GameObject if you need to keep the scene object independent from the new prefab asset. Leaving the replacement option disabled preserves the original object while still generating the reusable prefab.