unity-material
Edit material and shader properties across Built-in/URP/HDRP
How do I install this agent skill?
npx skills add https://github.com/besty0728/unity-skills --skill unity-materialIs this agent skill safe to install?
- Gen Agent Trust Hubpass
This skill provides a set of tools for managing Unity materials and shaders through a local API. No security risks were identified.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
- Runlayerpass
1 file scanned · No issues
What does this agent skill do?
Unity Material Skills
Create, assign and edit materials. Parameters come from the schema (GET /skills/schema?category=Material&wire=v2), never from a skill's name; execution and dryRun rules: root SKILL.md.
When to use
- Changing how a surface looks: colour, emission, texture, tiling or offset
- Tweaking material float, int or vector properties, or shader keywords
- Swapping a material's shader or render queue
- Creating materials and assigning them to renderers
Rules
- Use the
*_batchvariant for 2 or more objects or materials. - Targeting a GameObject edits its material asset, not that one object: every
material_set_*resolves the object torenderer.sharedMaterialand writes the asset on disk. A fresh primitive shares the built-inDefault-Material, somaterial_set_color(name="Cube")recolours every object using it. Write by asset path (path="Assets/.../X.mat") unless the object owns an unshared material;material_get_propertiesreturns thematerialPaththat would be written. - "Make this object red":
material_createwithsavePath,material_set_colorbypath, thenmaterial_assignwithmaterialPath. - In
material_set_*andmaterial_get_*,pathis a GameObject hierarchy path or a material asset path (Assets/...or.mat). Inmaterial_assign,pathis a GameObject path only; the material goes inmaterialPath. - Colour components are 0-1, not 0-255. HDR glow uses
intensityabove 1. - Skills detect the render pipeline. Pass
propertyNameonly when detection picks the wrong property, and trust the returnedpropertyUsed. - Persist materials with
savePath; a material created without it is lost on editor restart. - A rejected item fails the whole batch and rolls back the others (
rolledBack:true,results[i].reverted:true). - Operating mode:
material_get_propertiesandmaterial_get_keywordsare read-only; every writer isFullAuto. To delete a material asset, use theassetmodule.
| Pipeline | Default shader | Colour property | Texture property |
|---|---|---|---|
| Built-in | Standard | _Color | _MainTex |
| URP | Universal Render Pipeline/Lit | _BaseColor | _BaseMap |
| HDRP | HDRP/Lit | _BaseColor | _BaseColorMap |
Pitfalls
- URP Lit exposes both
_BaseColorand a legacy_Color; only_BaseColoris authoritative. A read of_Colorafter writing_BaseColorlooks like a failed write. - Shader property names differ per shader: read them from
material_get_properties. - Writes to a material assigned to many renderers change all of them.
Skills Overview
| Single | Batch |
|---|---|
material_create | material_create_batch |
material_assign | material_assign_batch |
material_set_color | material_set_colors_batch |
material_set_emission | material_set_emission_batch |
No batch: material_set_texture, material_set_texture_offset / material_set_texture_scale (tiling), material_set_float / material_set_int / material_set_vector, material_set_keyword (enable or disable shader keywords), material_set_render_queue, material_set_shader, material_set_gi_flags, material_get_properties / material_get_keywords (read), material_duplicate.
Per-skill parameter tables and return shapes: reference/<skill_name>.md.
DO NOT (common hallucinations):
material_set_metallic/material_set_smoothnessdo not exist: usematerial_set_floatwithpropertyName="_Metallic"and"_Glossiness"(Standard) or"_Smoothness"(URP).material_set_propertydoes not exist: usematerial_set_float,material_set_int,material_set_vectorormaterial_set_color.material_get_colordoes not exist: usematerial_get_properties, which returns colours too.- Shader changes go to
material_set_shader; tiling goes tomaterial_set_texture_scaleormaterial_set_texture_offset.
Common Errors
| Error | Trigger and fix |
|---|---|
TARGET_NOT_FOUND | Material asset, renderer, shader, texture or property missing. Verify with asset_find, gameobject_find or material_get_properties. |
MISSING_PARAM | e.g. materialPath, sourcePath, texturePath, propertyName, keyword, shaderName. Supply it; mode=dryRun lists all parameters. |
SEMANTIC_INVALID | Unknown GI flag, invalid asset path, a property the shader does not use, or a propertyName not declared as a colour. Correct it per the range or enum in the error. |
Transport codes → error codes.
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/besty0728/unity-skills/unity-material">View unity-material on skillZs</a>