Agent skill

Unity Csharp Scripting

by gamedev-skills in gamedev-skills/awesome-gamedev-agent-skills

Write Unity 6.3 LTS C gameplay scripts: the MonoBehaviour lifecycle (Awake/OnEnable/Start/Update/FixedUpdate/LateUpdate), GameObject and component access, coroutines, and Inspector serialization.

Apache-2.0Auto-check passedGame Development

Install Unity Csharp Scripting

skills CLI
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-csharp-scripting -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install gamedev-skills/awesome-gamedev-agent-skills unity-csharp-scripting --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/gamedev-skills/awesome-gamedev-agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/unity/unity-csharp-scripting .claude/skills/unity-csharp-scripting && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
unity-csharp-scripting
GitHub stars
1.4k
Token cost
~1.5k tokens
SKILL.md length
477 words
Files
2 (incl. references)
Skills in repo
53
Repo updated
First seen
Licence
Apache-2.0

At a glance

Write Unity 6.3 LTS C gameplay scripts: the MonoBehaviour lifecycle (Awake/OnEnable/Start/Update/FixedUpdate/LateUpdate), GameObject and component access, coroutines, and Inspector serialization.

  • Works in 4 steps: Lifecycle + cached components (the… → Safe component access with TryGetComponent → Serialization that shows up correctly in… → …
  • Editing .cs scripts in a Unity project
  • SKILL.md covers When to use, Core workflow, Patterns and Pitfalls, plus 2 more sections
  • Reaches docs.unity3d.com

What it does

Unity Csharp Scripting is an agent skill from gamedev-skills/awesome-gamedev-agent-skills. Write Unity 6.3 LTS C gameplay scripts: the MonoBehaviour lifecycle (Awake/OnEnable/Start/Update/FixedUpdate/LateUpdate), GameObject and component access, coroutines, and Inspector serialization. Use when creating or editing .cs scripts in a Unity project, or when the user mentions MonoBehaviour, Start/Update, GetComponent, SerializeField, coroutines, or "Unity script".

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/lifecycle-and-coroutines.md`).

It sits in Game Development, covering Game development. It works with C#. The repository describes itself as: 74 game-dev skills for AI coding agents — Godot, Unity, Unreal, Phaser, PixiJS, three.js, Bevy, pygame, LÖVE, Roblox. Portable SKILL.md Agent Skills (the format Anthropic… The licence is Apache-2.0.

When your agent uses it

  • Editing .cs scripts in a Unity project
  • The user mentions MonoBehaviour

Example prompts

  • “Unity script”
  • “/unity-csharp-scripting”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Lifecycle + cached components (the canonical skeleton)
  2. Safe component access with TryGetComponent
  3. Serialization that shows up correctly in the Inspector
  4. Coroutines for time-sequenced logic

What it can do on your machine

Read from SKILL.md and the folder at commit d4b0e35. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are csharp).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • docs.unity3d.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Unity Csharp Scripting loads about 1.5k tokens when it runs, and up to ~2.6k if it reads all its reference files. Until then it costs about 99 tokens; SKILL.md has 477 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~99
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from gamedev-skills/awesome-gamedev-agent-skills at commit d4b0e35, republished under its Apache-2.0 licence (© gamedev-skills). 477 words, ~1,542 tokens.

Download SKILL.mdSave it as .claude/skills/unity-csharp-scripting/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
unity-csharp-scripting
description
Write Unity 6.3 LTS C# gameplay scripts: the MonoBehaviour lifecycle (Awake/OnEnable/Start/Update/FixedUpdate/LateUpdate), GameObject and component access, coroutines, and Inspector serialization. Use when creating or editing .cs scripts in a Unity project, or when the user mentions MonoBehaviour, Start/Update, GetComponent, SerializeField, coroutines, or "Unity script".

Unity C# Scripting (MonoBehaviour)

Write correct, idiomatic gameplay scripts in Unity 6. Get the lifecycle, component access, serialization, and coroutines right so behaviour is deterministic and the Inspector stays useful. Targets Unity 6.3 LTS (6000.3), C# / .NET Standard 2.1.

When to use

  • Use when authoring or fixing a MonoBehaviour: choosing the right lifecycle callback, reading/caching components, exposing fields to the Inspector, or running timed logic with coroutines.
  • Use when the project has *.cs files, an Assembly-CSharp or *.asmdef, and a ProjectSettings/ folder.

When not to use: moving rigidbodies / collision response → unity-physics; reading player input → unity-input-system; shared data assets / config → unity-scriptableobjects; Animator parameters → unity-animation. This skill owns the script lifecycle and C# plumbing, not those subsystems.

Core workflow

  1. Pick the callback by purpose, not habit. Awake (cache references, runs once on load), OnEnable (subscribe to events), Start (init that depends on other objects' Awake), Update (per-frame logic/input polling), FixedUpdate (physics), LateUpdate (camera follow after movement), OnDisable/OnDestroy (unsubscribe/cleanup).
  2. Cache component lookups in Awake — never call GetComponent every frame.
  3. Expose tunables with [SerializeField] private, not public fields, so other code can't mutate them but designers can edit them in the Inspector.
  4. Scale per-frame values by Time.deltaTime in Update (and Time.fixedDeltaTime semantics are automatic in FixedUpdate).
  5. Use coroutines for time-sequenced logic (delays, tweens, "do X then wait then Y"); start them with StartCoroutine and stop them deterministically.
  6. Verify in Play mode: check the Console for null-reference exceptions, confirm values in the Inspector update as expected, and watch the Profiler if Update is hot.

Patterns

1. Lifecycle + cached components (the canonical skeleton)
csharp
using UnityEngine;

[RequireComponent(typeof(Rigidbody))]      // auto-adds the dependency, prevents null refs
public class PlayerController : MonoBehaviour
{
    [SerializeField] private float moveSpeed = 6f;   // editable in Inspector, private in code
    private Rigidbody _rb;                            // cached, not fetched per frame

    private void Awake() => _rb = GetComponent<Rigidbody>();  // cache once on load

    private void Update()
    {
        // Per-frame, non-physics work. Scale by deltaTime so it is frame-rate independent.
        transform.Rotate(0f, 90f * Time.deltaTime, 0f);
    }

    private void FixedUpdate()
    {
        // Physics work belongs here (fixed timestep). See the unity-physics skill.
        _rb.MovePosition(_rb.position + transform.forward * moveSpeed * Time.fixedDeltaTime);
    }
}
2. Safe component access with TryGetComponent
csharp
// Avoids allocating a null and is clearer than GetComponent + null check.
if (other.TryGetComponent<Health>(out var health))
    health.Apply(-10);
3. Serialization that shows up correctly in the Inspector
csharp
[SerializeField, Range(0f, 1f)] private float volume = 0.8f;  // slider
[SerializeField] private string playerName = "Hero";          // private but serialized

[System.Serializable]                 // REQUIRED for a plain class to serialize/show
public class Stats { public int hp = 100; public int mana = 50; }

[SerializeField] private Stats stats = new();  // nested struct-like data in the Inspector
4. Coroutines for time-sequenced logic
csharp
private void Start() => StartCoroutine(FlashThenHide());

private System.Collections.IEnumerator FlashThenHide()
{
    yield return new WaitForSeconds(0.5f);   // wait half a second of game time
    GetComponent<Renderer>().enabled = false;
    yield return null;                       // resume next frame
}
Show full SKILL.md (194 more words)Show less

Pitfalls

  • GetComponent in Update — it searches every frame and tanks performance. Cache the reference in Awake/Start.
  • Physics in Update — moving a Rigidbody with forces or MovePosition outside FixedUpdate causes jitter and timestep-dependent behaviour. Read input in Update, apply physics in FixedUpdate.
  • Relying on Start order across objects — Start runs after all Awakes, but order among Starts is undefined. Do cross-object wiring in Start, self-setup in Awake.
  • public fields just to show them in the Inspector — that also lets any script mutate them. Use [SerializeField] private instead.
  • gameObject.tag == "Enemy" allocates a string and is slower; use gameObject.CompareTag("Enemy").
  • Coroutines stop when the GameObject is disabled — a disabled object's coroutines are killed; re-StartCoroutine in OnEnable if it must survive toggling.
  • Update never runs before Start, but the first Update can run on the same frame as Start — guard against not-yet-initialised fields if you split setup oddly.

References

  • For the full event-execution-order table and advanced coroutine patterns (custom CustomYieldInstruction, stopping by handle, WaitUntil/WaitWhile), read references/lifecycle-and-coroutines.md.
  • Primary docs: Unity Manual "Event function execution order" (https://docs.unity3d.com/Manual/execution-order.html) and ScriptReference/MonoBehaviour.
  • unity-physics — Rigidbody, collisions, and FixedUpdate motion.
  • unity-input-system — reading player input into these scripts.
  • unity-scriptableobjects — sharing data/config between scripts without singletons.

© gamedev-skills, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/unity/unity-csharp-scripting of gamedev-skills/awesome-gamedev-agent-skills.

  • SKILL.md
  • references/lifecycle-and-coroutines.md

Open the folder on GitHubat commit d4b0e35

Compare with similar skills

Unity Csharp Scripting next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Unity Csharp Scripting compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Unity Csharp Scripting this skillgamedev-skills/awesome-gamedev-agent-skills1.4k—~1.5kAutomated safety check: PassApache-2.0
Validate GsdkPlayFab/gsdk170—~645Automated safety check: PassApache-2.0
Unity PluginTomLeeLive/openclaw-unity-plugin107—~5.1kAutomated safety check: PassApache-2.0
Godot 2D Essentialsjame581/GodotPrompter795—~2.3kAutomated safety check: PassMIT
Godot Admob App Openpoingstudios/godot-admob-plugin632—~1kAutomated safety check: PassMIT
Godot 3D Essentialsjame581/GodotPrompter795—~3.7kAutomated safety check: PassMIT

Similar skills

  • Validate Gsdk

    PlayFab/gsdk

    Validates PlayFab Game Server SDK (GSDK) integrations in game server projects.

    170 GitHub stars~645 tokensUpdated 3 days ago
    Game DevelopmentAuto-check passed
  • Unity Plugin

    TomLeeLive/openclaw-unity-plugin

    Control Unity Editor via OpenClaw Unity Plugin. An agent skill from TomLeeLive/openclaw-unity-plugin.

    107 GitHub stars~5.1k tokensUpdated 29 days ago
    Game DevelopmentAuto-check passed
  • Godot 2D Essentials

    jame581/GodotPrompter

    Covers Godot 4.3+ 2D systems with GDScript and C# examples: canvas layers, draw order, TileMaps, parallax, lights and shadows, particles and custom drawing.

    795 GitHub stars~2.3k tokensUpdated yesterday
    Game DevelopmentAuto-check passed
  • Godot Admob App Open

    poingstudios/godot-admob-plugin

    Provides instructions to implement, load, show, and destroy App Open ads (shown on application startup or app resume) in GDScript and C.

    632 GitHub stars~1k tokensUpdated 7 days ago
    Game DevelopmentAuto-check passed
  • Godot 3D Essentials

    jame581/GodotPrompter

    Covers Godot 4.3+ 3D systems such as materials, lighting, shadows, environment, global illumination, fog, LOD, occlusion culling and decals, with GDScript first and C# second.

    795 GitHub stars~3.7k tokensUpdated yesterday
    Game DevelopmentAuto-check passed
  • Godot Admob Banner

    poingstudios/godot-admob-plugin

    Provides instructions to implement, load, and destroy banner ads (AdView) using custom or adaptive sizes in GDScript and C.

    632 GitHub stars~718 tokensUpdated 7 days ago
    Game DevelopmentAuto-check passed

More from gamedev-skills/awesome-gamedev-agent-skills

All 53 skills in this repo
  • Create Game Assets

    gamedev-skills/awesome-gamedev-agent-skills

    Plan, generate, source, normalize, and validate cohesive visual game assets.

    1.4k GitHub stars~2k tokensUpdated 11 days ago
    Auto-check passed
  • Roblox UI

    gamedev-skills/awesome-gamedev-agent-skills

    Build production Roblox interfaces with ScreenGui/PlayerGui lifecycle, responsive UDim2 layouts, safe insets, reusable editable Instances, cross-device input and selection, restrained motion…

    1.4k GitHub stars~2.9k tokensUpdated 11 days ago
    Auto-check passed
  • AI Behavior Trees Utility AI

    gamedev-skills/awesome-gamedev-agent-skills

    Build a production behavior-tree runtime (Blackboard, action/condition leaves, sequence/selector/parallel composites, decorators) and a Utility AI system (response curves — linear, exponential…

    1.4k GitHub stars~2k tokensUpdated 11 days ago
    Auto-check passed
  • Bevy Ecs

    gamedev-skills/awesome-gamedev-agent-skills

    Structure a Bevy app around its Entity Component System: build the App with plugins, define Component/Resource types, write systems with Query/Res/Commands, filter and order systems, and use the…

    1.4k GitHub stars~2k tokensUpdated 11 days ago
    Auto-check passed
  • Card Game

    gamedev-skills/awesome-gamedev-agent-skills

    Build a card game: card data, deck/hand/discard zones, draw/shuffle/reshuffle, a turn structure, costs, and effect resolution.

    1.4k GitHub stars~1.6k tokensUpdated 11 days ago
    Auto-check passed
  • Fps Shooter

    gamedev-skills/awesome-gamedev-agent-skills

    Build a first-person shooter: move+mouse-look controller, hitscan or projectile shooting, weapons, health, and enemy AI.

    1.4k GitHub stars~1.5k tokensUpdated 11 days ago
    Auto-check passed

Works with

Questions about Unity Csharp Scripting

What does Unity Csharp Scripting do?

Write Unity 6.3 LTS C gameplay scripts: the MonoBehaviour lifecycle (Awake/OnEnable/Start/Update/FixedUpdate/LateUpdate), GameObject and component access, coroutines, and Inspector serialization. Unity Csharp Scripting is an agent skill from gamedev-skills/awesome-gamedev-agent-skills.3 LTS C gameplay scripts: the MonoBehaviour lifecycle (Awake/OnEnable/Start/Update/FixedUpdate/LateUpdate), GameObject and component access, coroutines, and Inspector serialization.

When should I use Unity Csharp Scripting?

Unity Csharp Scripting fits situations like: editing .cs scripts in a Unity project; the user mentions MonoBehaviour.

How do I install Unity Csharp Scripting in Claude Code?

Run `npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-csharp-scripting -a claude-code`. Or copy the skill folder (skills/unity/unity-csharp-scripting in gamedev-skills/awesome-gamedev-agent-skills) into .claude/skills/unity-csharp-scripting in your project. Claude Code loads it when a task matches its description.

How do I install Unity Csharp Scripting in Codex?

Run `npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-csharp-scripting -a codex`. Or copy the skill folder (skills/unity/unity-csharp-scripting in gamedev-skills/awesome-gamedev-agent-skills) into .agents/skills/unity-csharp-scripting in your project. Codex loads it when a task matches its description.

Can I use Unity Csharp Scripting in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-csharp-scripting -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/unity-csharp-scripting, .gemini/skills/unity-csharp-scripting, .github/skills/unity-csharp-scripting and .opencode/skills/unity-csharp-scripting in your project.

What does Unity Csharp Scripting need to run?

SKILL.md names no scripts, command-line tools or credentials: Unity Csharp Scripting is instructions for the agent only.

Does Unity Csharp Scripting access the network?

SKILL.md names 1 domain. In commands or code: docs.unity3d.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Unity Csharp Scripting safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Unity Csharp Scripting use?

Unity Csharp Scripting is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Unity Csharp Scripting use?

About 1.5k tokens (SKILL.md is roughly 6.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.1k tokens, read only when the agent opens those files.

What are the alternatives to Unity Csharp Scripting?

Skills that share tags, products or a category with Unity Csharp Scripting: Validate Gsdk (PlayFab/gsdk, 170 stars), Unity Plugin (TomLeeLive/openclaw-unity-plugin, 107 stars), Godot 2D Essentials (jame581/GodotPrompter, 795 stars) and Godot Admob App Open (poingstudios/godot-admob-plugin, 632 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Unity Csharp Scripting?

gamedev-skills (a GitHub organization) maintains it in gamedev-skills/awesome-gamedev-agent-skills, which has 1,356 GitHub stars. The repository holds 53 skills in this directory. The repository was last updated on September 27, 2026.

Source: gamedev-skills/awesome-gamedev-agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.