assets-prefab-instantiate

Instantiates a prefab in the active Unity scene at specified position, rotation, and scale.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Instantiates a prefab in the current active Unity scene, reducing manual setup time and errors when building scenes.

Core Features & Use Cases

  • Instant prefab placement: place a prefab at a specified location, rotation, and scale in the active scene.
  • Flexible space handling: supports world or local space for transform application.
  • Integration with asset discovery: works with assets-found results to locate prefabs efficiently.
  • Use Case: Automated level setup during runtime or automated test scene preparation.

Quick Start

Call the assets-prefab-instantiate tool with prefabAssetPath and gameObjectPath to place the prefab in the active scene.

Frequently Asked Questions about assets-prefab-instantiate

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

FAQPage Schema
How do I instantiate a Unity prefab at a specific position and rotation in the active scene?

To instantiate a Unity prefab in the active scene, provide the prefabAssetPath and gameObjectPath, along with optional position, rotation, and scale values. This automation places the prefab directly in the scene, reducing manual setup time and errors.

Can I apply local space transforms when instantiating prefabs in Unity?

Yes, you can apply local space transforms when instantiating prefabs by using the optional isLocalSpace parameter. This allows flexible space handling for applying position, rotation, and scale in either world or local space.

What is the best way to automate level assembly and runtime scene setup in Unity?

Automating level assembly in Unity is best done by using an API to instantiate prefabs at specified positions, rotations, and scales. This reduces manual setup errors and efficiently prepares runtime scenes or automated test environments.

Does prefab instantiation work with asset discovery results?

Yes, prefab instantiation integrates with assets-found results to locate prefabs efficiently. By passing the discovered prefab asset path to the instantiation process, you can seamlessly place objects in the active Unity scene.

What inputs do I need to place a prefab in a Unity scene automatically?

You need the prefabAssetPath and gameObjectPath as required inputs to place a prefab automatically. Optional inputs include position, rotation, scale, and isLocalSpace, which output a GameObject reference for further manipulation.