Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Game Code Debugging Agent

    1

    Expert Unity C# debugging for gameplay code, lifecycle conflicts, and serialization issues.

    $19.99

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Game Code Debugging Agent

    Game Code Debugging Agent

    Example session with this skill installed

    My Unity 2022.3 C# script throws a NullReferenceException when the player respawns. Here is the stack trace and the PlayerHealth script. Find the cause and a fix.

    • Read your context and instructions
    • Compiled the game code debugging

    I have analyzed the PlayerHealth.cs script against the provided stack trace. The error occurs because the UIUpdate event is called during the respawn sequence before the UIManager has re-initialized its reference to the new Player instance.

    Debugging Report

    Diagnosis Summary
    A NullReferenceException occurs in PlayerHealth.OnEnable() because it attempts to invoke a delegate on a singleton that is being destroyed/recreated during the scene reload.

    Evidence Reviewed

    • Stack trace points to line 42: UIManager.Instance.UpdateHealthBar(currentHealth);
    • PlayerHealth.cs source shows OnEnable calling the singleton without checking for null.
    • Respawn logic triggers a fast scene reload, creating a race condition between OnDisable and OnEnable.

    Most Likely Cause
    The UIManager singleton instance is null for exactly one frame during the reload sequence while the Player object is being re-instantiated.
    Confidence: High

    Minimal Patch

    // PlayerHealth.cs
    private void OnEnable()
    {
        // Fix: Added null check for singleton instance during scene transitions
        if (UIManager.Instance != null)
        {
            UIManager.Instance.UpdateHealthBar(currentHealth);
        }
        else
        {
            Debug.LogWarning("PlayerHealth: UIManager instance not found during OnEnable. UI update deferred.");
        }
    }
    

    Reproduction and Validation

    Test IDScenarioStepsExpected ResultStatus
    VAL-01Standard RespawnTrigger 'Die' functionHealth bar resets without NRENot Run
    VAL-02Rapid ReloadSpam respawn keyNo console errorsNot Run

    Next steps

    1. Apply the null check to PlayerHealth.cs.
    2. Check the Execution Order settings in Project Settings to ensure UIManager initializes before PlayerHealth.
    3. Implement a UnityEvent based approach to decouple the UI from the Player lifecycle.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Debugging Unity C# gameplay code is a time sink. Tracking down null references in deep lifecycles or fixing race conditions in async tasks often leads to more bugs when the fix is too broad.

    This skill investigates C# gameplay and tooling issues using your logs, stack traces, and scripts. It produces evidence-linked diagnoses and minimal patches that respect your existing architecture.

    What it does

    • Error triage maps stack traces to specific code frames to find the first actionable failure.
    • Lifecycle analysis identifies conflicts in MonoBehaviour execution order, coroutines, and object lifetimes.
    • Serialization checks spots issues with Inspector references, prefab wiring, and Addressables.
    • Patch generation provides minimal, safe code fixes that maintain your project's coding style.
    • Test design creates specific Edit Mode and Play Mode test cases for regression protection.

    How it works

    1. Provide context by sharing your script, the full stack trace, and the Unity version.
    2. Select a mode like diagnose for analysis or patch for a direct code solution.
    3. Review hypotheses categorized by confidence levels and supporting evidence.
    4. Implement the fix using the provided code snippets and any required Inspector adjustments.

    Frameworks & tools

    Specifically optimized for Unity (C#) environments. Supports Unity Test Framework, Addressables, the New Input System, and standard MonoBehaviour lifecycles.

    Why this beats prompting it yourself

    Generic LLMs often suggest broad refactors or hallucinate APIs from other engines like Unreal or Godot. This skill enforces Unity-specific rules, distinguishing between Play Mode and build-only failures while preserving your specific serialization patterns.

    Use cases

    • Debugging NullReferenceException errors triggered during scene transitions or player respawns.
    • Fixing event subscription leaks in UI components or singleton instances.
    • Resolving frame-dependent physics bugs and Rigidbody configuration mismatches.
    • Triaging build-only failures that do not appear in the Unity Editor.

    Known limitations

    Does not perform actual code execution or profiling. Relies entirely on provided code snippets and log artifacts. Optimized for Unity and C# only.

    No real-time execution or profiler access. Restricted to Unity C# environments. Requires manually provided logs and code snippets to function.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 13 days ago

    Permissions

    Read Files
    Listed13 days ago

    What's inside

    Frequently Asked Questions

    The agent is specifically tuned for Unity C# environments, preventing common LLM hallucinations like non-existent APIs or suggestions for other engines like Godot or Unreal. It understands Unity-specific nuances such as MonoBehaviour execution order, Inspector serialization, and the difference between Editor and Build-time failures.

    This skill is compatible with any AI agent platform that supports text-based input and code analysis. To get the best results, you should provide the C# script, the full Unity Console stack trace, and your specific Unity version for context.

    Yes, the skill includes specialized logic for the Unity Test Framework. It can generate specific Edit Mode and Play Mode test cases designed to reproduce the bug and ensure the patch prevents future regressions.

    No installation into the Unity Editor is required. The skill functions as a diagnostic layer for your AI agent; you simply feed it your logs and code snippets to receive analysis and patches.

    The agent is highly effective at triaging "build-only" failures by analyzing log files from standalone builds. It compares these logs against your Editor-side scripts to identify issues like missing references or platform-specific execution differences.

    New in Game Development