- Home
- Skills
- Besty0728
- Unity Skills
- Gameobject
gameobject_skill
- C#
44
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill besty0728/unity-skills --skill gameobject- SKILL.md7.7 KB
Overview
This skill provides a compact set of Unity GameObject operations for creating, deleting, finding, and modifying GameObjects inside a scene. It supports single-object calls and batch variants that combine multiple operations into one API call for efficiency. Use the batch versions when working on two or more objects to reduce round trips. The skill returns useful identifiers and state so callers can chain operations reliably.
How this skill works
Each operation accepts common identifiers (name, instanceId, or hierarchy path) so you can target objects reliably; instanceId is preferred for uniqueness. Single-object skills perform one change per call, while *_batch skills accept an items array to apply many changes in a single request. Query skills let you search by name, tag, layer, or component and retrieve detailed object info including transform, components, and children. Responses include success flags and returned metadata (names, instanceIds, paths, positions) for follow-up actions.
When to use it
- Create or arrange a small number of objects: use single-object skills for quick edits.
- Create, move, rename, or delete 2+ objects at once: always use the *_batch variants to reduce API calls.
- Find objects by criteria before operating on them (use gameobject_find to get instanceIds).
- Get full object state for debugging or tooling with gameobject_get_info.
- Change parenting, tags, or layers for multiple objects in one coordinated step.
Best practices
- Prefer instanceId when available to avoid ambiguity from duplicate names.
- Group related changes into a single batch call whenever you operate on multiple objects.
- Use gameobject_find with limits or filters to avoid large result sets in complex scenes.
- Apply transforms and parenting in separate logical batches to keep operations predictable.
- Return and store response instanceIds when creating objects to reference them reliably later.
Example use cases
- Scene setup: create dozens of primitives with gameobject_create_batch, then set transforms with gameobject_set_transform_batch.
- Level editing: deactivate many enemies for a cutscene using gameobject_set_active_batch.
- Refactoring hierarchy: reparent wheels to a car object using gameobject_set_parent_batch.
- Bulk tagging and layering: apply collision or rendering layers to multiple objects using gameobject_set_layer_batch and gameobject_set_tag_batch.
- Automation scripts: find objects by component, duplicate them, and rename copies with the batch duplicate and rename flows.
FAQ
Use batch skills whenever you need to operate on two or more objects to minimize API calls and improve performance.
What identifier is safest to use?
InstanceId is the safest because names can be duplicated; supply path or name when instanceId is not available.