unity-csharp-scripting
Writes and fixes Unity 6.3 LTS C# gameplay scripts: MonoBehaviour lifecycle, serialization, .meta/GUID discipline and command-line tests. Use for new or renamed .cs files, "Missing script" or a field missing from the Inspector.
Install / Use
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-csharp-scriptingInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
AutomationSupported Platforms
Tags
Our assessment of unity-csharp-scripting
unity-csharp-scripting scores 95/100 on our quality scale, 264th of 2,780 Automation skills we index (top 10%).
Its SKILL.md is 6.0 KB long, well organised into 11 sections with 4 code examples: a thorough specification that gives an agent plenty to work with.
With 8,904 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 4 days ago, so unity-csharp-scripting is actively maintained.
- Our last check on 2026-11-15 found the source still online.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-10-08. Automated pattern scan on 2026-10-08. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
unity-csharp-scripting compared with similar skills
All 4 of these similar skills score higher than unity-csharp-scripting; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| unity-csharp-scripting (this skill)by gamedev-skills | 95 | 8.9k | 4d ago | SKILL.md |
| Agent-Reachby Panniantong | 100 | 112.3k | 9d ago | CLAUDE.md |
| rufloby ruvnet | 100 | 81.9k | today | CLAUDE.md |
| Claude-Code-Game-Studiosby Donchitos | 100 | 39.7k | 7d ago | CLAUDE.md |
| Scraplingby D4Vinci | 100 | 103.6k | 2d ago | MCP Server |
Frequently asked questions
- How do I install unity-csharp-scripting?
- Run
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-csharp-scripting. The install tabs above show the steps for each supported agent. - Which AI agents does unity-csharp-scripting work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is unity-csharp-scripting safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is Apache-2.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is unity-csharp-scripting still maintained?
- The repository was last updated 4 days ago, so unity-csharp-scripting is actively maintained.
Skill content
View source on GitHubname: 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
*.csfiles, anAssembly-CSharpor*.asmdef, and aProjectSettings/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
- 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). - Cache component lookups in
Awake— never callGetComponentevery frame. - Expose tunables with
[SerializeField] private, not public fields, so other code can't mutate them but designers can edit them in the Inspector. - Scale per-frame values by
Time.deltaTimeinUpdate(andTime.fixedDeltaTimesemantics are automatic inFixedUpdate). - Use coroutines for time-sequenced logic (delays, tweens, "do X then wait then Y");
start them with
StartCoroutineand stop them deterministically. - Verify in Play mode: check the Console for null-reference exceptions, confirm values
in the Inspector update as expected, and watch the Profiler if
Updateis hot.
Patterns
1. Lifecycle + cached components (the canonical skeleton)
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
// 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
[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
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
}
Pitfalls
GetComponentinUpdate— it searches every frame and tanks performance. Cache the reference inAwake/Start.- Physics in
Update— moving aRigidbodywith forces orMovePositionoutsideFixedUpdatecauses jitter and timestep-dependent behaviour. Read input inUpdate, apply physics inFixedUpdate. - Relying on
Startorder across objects —Startruns after allAwakes, but order amongStarts is undefined. Do cross-object wiring inStart, self-setup inAwake. publicfields just to show them in the Inspector — that also lets any script mutate them. Use[SerializeField] privateinstead.gameObject.tag == "Enemy"allocates a string and is slower; usegameObject.CompareTag("Enemy").- Coroutines stop when the GameObject is disabled — a disabled object's coroutines are
killed; re-
StartCoroutineinOnEnableif it must survive toggling. Updatenever runs beforeStart, but the firstUpdatecan run on the same frame asStart— 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), readreferences/lifecycle-and-coroutines.md. - Primary docs: Unity Manual "Event function execution order"
(
https://docs.unity3d.com/Manual/execution-order.html) andScriptReference/MonoBehaviour.
Related skills
unity-physics—Rigidbody, collisions, andFixedUpdatemotion.unity-input-system— reading player input into these scripts.unity-scriptableobjects— sharing data/config between scripts without singletons.
Related Skills
Agent-Reach
112.3kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
ruflo
81.9k🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
Claude-Code-Game-Studios
39.7kTurn Claude Code into a full game dev studio — 49 AI agents, 72 workflow skills, and a complete coordination system mirroring real studio hierarchy.
Scrapling
103.6k🕷️ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
