unity-material
Skill7 starsChanged 7 months agoMITView on GitHub
Use when users want to create materials, set colors, textures, emission, or shader properties.
In this repository34 other files it gives its agents.
- unity-mcp-skillsSkill
- unity-animatorSkill
- unity-assetSkill
- unity-cameraSkill
- unity-cinemachineSkill
- unity-cleanerSkill
- unity-componentSkill
- unity-consoleSkill
- unity-editorSkill
- unity-eventSkill
- unity-gameobjectSkill
- unity-importerSkill
- unity-lightSkill
- unity-navmeshSkill
- unity-optimizationSkill
- unity-packageSkill
- unity-perceptionSkill
- unity-physicsSkill
- unity-prefabSkill
- unity-probuilderSkill
- unity-projectSkill
- unity-sceneSkill
- unity-scriptableobjectSkill
- unity-scriptSkill
- unity-shaderSkill
- unity-smartSkill
- unity-terrainSkill
- unity-testSkill
- unity-timelineSkill
- unity-toolingSkill
- unity-uiSkill
- unity-uitoolkitSkill
- unity-validationSkill
- unity-xrSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 54
Create a new material (auto-detects render pipeline).
- Distinctive: line 260
Use material instances (by name) for runtime changes
- Distinctive: line 261
Use material assets (by path) for persistent changes
- Distinctive: line 262
Check shader property names in Unity Inspector
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Unity Material Skills
Overview
BATCH-FIRST: Use
*_batchskills when operating on 2+ objects/materials.
Common Mistakes
DO NOT (common hallucinations):
material_set_metallic/material_set_smoothnessdo not exist → usematerial_set_floatwithpropertyName="_Metallic"or"_Glossiness"(Standard) /"_Smoothness"(URP)material_set_colorr/g/b/a range is 0–1, not 0–255material_set_propertydoes not exist → use the specific setter:material_set_float,material_set_int,material_set_vector,material_set_colormaterial_get_colordoes not exist → usematerial_get_properties(returns all properties including colors)
Routing:
- For shader changes →
material_set_shader(this module) - For texture tiling →
material_set_texture_scale/material_set_texture_offset - Pipeline-specific property names differ: check Render Pipeline Compatibility table in this doc
Object Targeting: Single-object skills accept
name(GameObject name) orpath(material asset path likeAssets/Materials/X.mat). For asset-based operations, preferpath.
Recipe path rule: ../../recipes/material/<command>.md
Skills Overview
| Single Object | Batch Version | Use Batch When |
material_create | material_create_batch | Creating 2+ materials |
material_assign | material_assign_batch | Assigning to 2+ objects |
material_set_color | material_set_colors_batch | Setting colors on 2+ objects |
material_set_emission | material_set_emission_batch | Setting emission on 2+ objects |
No batch needed:
material_set_texture- Set texturematerial_set_texture_offset/scale- Texture tilingmaterial_set_float/int/vector- Set propertiesmaterial_set_keyword- Enable/disable shader keywordsmaterial_set_render_queue- Set render queuematerial_set_shader- Change shadermaterial_get_properties/keywords- Query propertiesmaterial_duplicate- Duplicate material
Skills
material_create
Create a new material (auto-detects render pipeline).
| Parameter | Type | Required | Default | Description |
name | string | Yes | - | Material name |
shaderName | string | No | auto-detect | Shader (auto-detects URP/HDRP/Standard) |
savePath | string | No | null | Save path (folder or full path) |
material_create_batch
Create multiple materials.
Returns: {success, totalItems, successCount, failCount, results: [{success, name, path}]}
material_assign
Assign material to object's renderer.
| Parameter | Type | Required | Description |
name | string | No* | GameObject name |
instanceId | int | No* | Instance ID |
path | string | No* | Material asset path (for asset) |
materialPath | string | Yes | Material to assign |
material_assign_batch
Assign materials to multiple objects.
Returns: {success, totalItems, successCount, failCount, results: [{success, name, materialPath}]}
material_set_color
Set material color with optional HDR intensity.
| Parameter | Type | Required | Default | Description |
name | string | No* | GameObject name | |
path | string | No* | Material asset path | |
r, g, b | float | No | 1 | Color (0-1) |
a | float | No | 1 | Alpha |
propertyName | string | No | auto-detect | Color property |
intensity | float | No | 1.0 | HDR intensity (>1 for bloom) |
material_set_colors_batch
Set colors on multiple objects.
Returns: {success, totalItems, successCount, failCount, results: [{success, name}]}
material_set_emission
Set emission color with auto-enable keyword.
| Parameter | Type | Required | Default | Description |
name | string | No* | GameObject name | |
path | string | No* | Material asset path | |
r, g, b | float | No | 1 | Emission color (0-1) |
intensity | float | No | 1.0 | HDR intensity (>1 for bloom) |
enableEmission | bool | No | true | Auto-enable _EMISSION keyword |
material_set_emission_batch
Set emission on multiple objects.
Returns: {success, totalItems, successCount, failCount, results: [{success, name}]}
material_set_texture
Set material texture.
| Parameter | Type | Required | Default | Description |
name | string | No* | GameObject name | |
path | string | No* | Material asset path | |
texturePath | string | Yes | - | Texture asset path |
propertyName | string | No | auto-detect | Texture property |
material_set_float
Set a float property on a material.
| Parameter | Type | Required | Description |
name | string | No* | GameObject name |
path | string | No* | Material asset path |
propertyName | string | Yes | Property name |
value | float | Yes | Value |
material_set_int
Set an integer property on a material.
| Parameter | Type | Required | Description |
name | string | No* | GameObject name |
path | string | No* | Material asset path |
propertyName | string | Yes | Property name |
value | int | Yes | Value |
material_set_keyword
Enable/disable shader keywords.
| Parameter | Type | Required | Default | Description |
name | string | No* | GameObject name | |
path | string | No* | Material asset path | |
keyword | string | Yes | - | Keyword name |
enable | bool | No | true | Enable or disable |
Common Keywords: _EMISSION, _NORMALMAP, _METALLICGLOSSMAP, _ALPHATEST_ON, _ALPHABLEND_ON
material_get_properties
Get all material properties.
| Parameter | Type | Required | Description |
name | string | No* | GameObject name |
path | string | No* | Material asset path |
Returns: {colors, floats, vectors, textures, integers, keywords, renderQueue}
material_get_keywords
Get all enabled shader keywords on a material.
| Parameter | Type | Required | Description |
name | string | No* | GameObject name |
path | string | No* | Material asset path |
material_duplicate
Duplicate a material asset.
| Parameter | Type | Required | Description |
sourcePath | string | Yes | Source material path |
newName | string | Yes | Name for the duplicated material |
savePath | string | No | Optional folder/path override for the duplicated material |
material_set_shader
Change the shader of a material.
| Parameter | Type | Required | Description |
name | string | No* | GameObject name |
path | string | No* | Material asset path |
shaderName | string | Yes | Shader name |
material_set_vector
Set a Vector4 property on a material.
| Parameter | Type | Required | Description |
name | string | No* | GameObject name |
path | string | No* | Material asset path |
propertyName | string | Yes | Property name |
x, y, z, w | float | Yes | Vector components |
material_set_texture_offset
Set texture offset (tiling position).
| Parameter | Type | Required | Description |
name | string | No* | GameObject name |
path | string | No* | Material asset path |
propertyName | string | No | Texture property name |
x, y | float | Yes | Offset values |
material_set_texture_scale
Set texture scale (tiling).
| Parameter | Type | Required | Description |
name | string | No* | GameObject name |
path | string | No* | Material asset path |
propertyName | string | No | Texture property name |
x, y | float | Yes | Scale values |
material_set_render_queue
Set material render queue.
| Parameter | Type | Required | Description |
name | string | No* | GameObject name |
path | string | No* | Material asset path |
renderQueue | int | Yes | Render queue value |
material_set_gi_flags
Set material global illumination flags.
| Parameter | Type | Required | Description |
name | string | No* | GameObject name |
path | string | No* | Material asset path |
flags | string | Yes | GI flags (None/Emissive/RealtimeEmissive/BakedEmissive) |
Example: Efficient Material Setup
See ../../recipes/material/README.md for per-command C# templates.
Render Pipeline Compatibility
Skills auto-detect and adapt to your render pipeline:
| Pipeline | Default Shader | Color Property | Texture Property |
| Built-in | Standard | _Color | _MainTex |
| URP | Universal Render Pipeline/Lit | _BaseColor | _BaseMap |
| HDRP | HDRP/Lit | _BaseColor | _BaseColorMap |
Best Practices
- Save materials as assets for reuse
- Use material instances (by name) for runtime changes
- Use material assets (by path) for persistent changes
- Check shader property names in Unity Inspector
- URP/HDRP have different property names than Standard
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

