Skip to content
Loadout

Unity 6

Cursor rules for Unity 6

Unity 6 C# rules that avoid the obsolete 2022 APIs.

Free packs are MIT licensed

Verified on 2026-10-15 · zip downloads · version-pinned

Unity 6Input System

Verified for

  • Unity 6.3 LTS (6000.3.x), APIs checked against 6000.6 docs on 2026-10-15
  • Input System com.unity.inputsystem (Unity 6 new-project default)

Last tested 2026-10-15

Doc-verified only

doc-verified

The rules

Keeps agents off the calls Unity 6 removed or replaced: FindObjectOfType, Rigidbody.velocity, and the legacy Input Manager. Also stops the two Unity-specific footguns, deleting .meta files and running dotnet build.

Related fixes

Who it's for

People using an AI agent inside a Unity 6 (6000.x) project, including Unity MCP setups.

Loadout Pro Bundle

$1+ · pay what you want

What you get

  • Phaser 4 (4.2.1)
  • three.js (r186)
  • FastAPI (0.143 / Pydantic 2.14)

Each pack ships as AGENTS.md, CLAUDE.md, Cursor .mdc, and Copilot instructions, with 12 months of free updates.

Get Pro on Gumroad

Install

Copy one file, or download the zip for that tool. The zip already uses the path below.

  1. Cursor

    .cursor/rules/unity-6.mdc

    1. Download the Cursor zip, or copy the .mdc file from this page.
    2. Save it as .cursor/rules/unity-6.mdc.
    3. Commit it. Cursor reads project rules from that folder.
  2. Claude Code

    CLAUDE.md

    1. Download the Claude zip, or copy CLAUDE.md.
    2. Put CLAUDE.md in the project root.
    3. Claude Code reads it as project memory on the next session.
  3. AGENTS.md

    AGENTS.md

    1. Download the Agents zip, or copy AGENTS.md.
    2. Put AGENTS.md in the project root.
    3. Agents that read AGENTS.md, including Codex and Cursor, pick it up there.
  4. GitHub Copilot

    .github/copilot-instructions.md

    1. Download the Copilot zip, or copy the instructions file.
    2. Save it as .github/copilot-instructions.md.
    3. Copilot reads repository instructions from that path.

Questions

What does the Unity 6 pack do?
Keeps agents off the calls Unity 6 removed or replaced: FindObjectOfType, Rigidbody.velocity, and the legacy Input Manager. Also stops the two Unity-specific footguns, deleting .meta files and running dotnet build.
Who is the Unity 6 pack for?
People using an AI agent inside a Unity 6 (6000.x) project, including Unity MCP setups.
Which versions does the Unity 6 pack pin?
Unity: 6.3 LTS (6000.3.x), APIs checked against 6000.6 docs on 2026-10-15 Input System: com.unity.inputsystem (Unity 6 new-project default) FindFirstObjectByType is valid on 6.0 but obsolete on 6.6. This pack tells the agent to use FindAnyObjectByType instead, which is valid on both. Last tested 2026-10-15.
How do I install the Unity 6 pack?
Copy .cursor/rules/unity-6.mdc into the repo for Cursor, CLAUDE.md for Claude Code, AGENTS.md for other agents, and .github/copilot-instructions.md for GitHub Copilot. A format zip already uses that path. Then commit the files.
When was the Unity 6 pack last tested, and how?
Last tested 2026-10-15. doc-verified.

Plain text

The same pack as markdown, plus each rules file on its own URL.

Files

.cursor/rules/unity-6.mdc

---
description: Unity 6.3 LTS C# rules. Input System, linearVelocity, no FindObjectOfType, never touch .meta files.
globs: "**/*.cs"
alwaysApply: false
---
# Unity 6 C# rules

Pinned to Unity 6.3 LTS (6000.3.x, supported through December 2027). The same calls are valid on the 6000.6 update line checked 2026-10-15, with one exception called out below. Do not emit Unity 2022 or earlier APIs.

## Project files
- Never delete, rename, or hand-edit a `.meta` file. Unity stores the asset GUID there. Deleting one reimports the asset and breaks every reference to it.
- Do not run `dotnet build` to "check" a Unity project. The editor compiles assemblies itself. A bare `dotnet build` fails or compiles the wrong set of asmdefs.
- Edit scripts under `Assets/`. Do not write into `Library/`, `Temp/`, `Obj/`, or `Logs/`.

## Finding objects
- `Object.FindObjectOfType` and `FindObjectsOfType` are obsolete. Do not use them.
- When any match is fine, use `Object.FindAnyObjectByType<T>()`. Do not call it from `Update` or `FixedUpdate`. Cache the result in `Awake` or `Start`.
- On Unity 6.6 and newer, `FindFirstObjectByType` is also obsolete, because it depended on InstanceID ordering. Do not use it. If you need a specific object, query with `FindObjectsByType<T>()` and sort by something real, such as sibling index.
- Prefer a serialized reference (`[SerializeField] private Player player;`) over any Find call.

## Input and physics
- Read input through the Input System package (`UnityEngine.InputSystem`). Do not call `Input.GetAxis`, `Input.GetKey`, or `Input.GetButton`. Those throw when the project is set to the new Input System only, which is the Unity 6 default for new projects.
- Read buttons in `Update`. Write to a Rigidbody in `FixedUpdate`.
- The velocity property is `Rigidbody.linearVelocity` (world space, units per second). `Rigidbody.velocity` does not exist in Unity 6. Do not assign `linearVelocity` every physics step. Use `AddForce` for ongoing motion and set `linearVelocity` only for an instant change such as a jump.
- Cache `GetComponent<Rigidbody>()` once. Do not call `GetComponent`, `Find`, or `Camera.main` inside `Update`.

```csharp
using UnityEngine;
using UnityEngine.InputSystem;

public class Jumper : MonoBehaviour
{
    [SerializeField] private float jumpSpeed = 6f;
    private Rigidbody body;
    private bool jumpPressed;

    private void Awake()
    {
        body = GetComponent<Rigidbody>();
    }

    private void Update()
    {
        jumpPressed = Keyboard.current != null && Keyboard.current.spaceKey.wasPressedThisFrame;
    }

    private void FixedUpdate()
    {
        if (!jumpPressed) return;
        body.linearVelocity = new Vector3(body.linearVelocity.x, jumpSpeed, body.linearVelocity.z);
        jumpPressed = false;
    }
}
```

## Data and safety
- Expose designer fields with `[SerializeField] private`. Do not make gameplay fields public just so the Inspector can see them.
- Put tuneable numbers (damage, speeds, drop tables) on a ScriptableObject asset, not in a hardcoded constant inside a behaviour.
- Compare tags with `CompareTag("Player")`, not `tag == "Player"`.
- Null-check `Keyboard.current` and action references. They are null when the device is missing or the domain reloads.

## Async and timing
- For waits, prefer `Awaitable` (`await Awaitable.WaitForSecondsAsync(1f)`) or a coroutine. Do not use `Thread.Sleep` or `Task.Delay` on the main thread.
- Unity objects are not thread-safe. Touch `Transform`, `GameObject`, and components only on the main thread.
- Check `this != null` after an `await`. The object may have been destroyed while the method was suspended.

## Scenes and prefabs
- Do not write YAML into `.unity`, `.prefab`, or `.asset` files by hand. Change them in the editor or through an editor script.
- Load scenes by name or build index with `SceneManager.LoadSceneAsync`. Add the scene to the build profile first.
- Instantiate prefabs from a serialized reference, not `Resources.Load`, unless the project already uses Resources.

## Done checklist
1. The Console shows no compile errors after the editor recompiles.
2. No obsolete-API warnings were introduced (`FindObjectOfType`, `velocity`, `Input.*`).
3. You said whether Play Mode was actually tested.

Changelog

Placeholder. This is the first published cut, last verified on 2026-10-15. Version notes will replace this block when the pack is revised.