BEST PRACTICES

PROMPTING TIPS & RECIPES

Brody AI understands Unity engine specifics, serialized attributes, and Roslyn AST patterns. By structuring your prompts with precise context, you unlock instant, production-ready code with zero hallucinated methods.

The 4 Golden Rules of Unity Prompting

RULE 01

Use @ Mentions for Instant Context

Type @ in the Unity chat to inject your active Scene, C# scripts, or GameObjects. Brody immediately reads the exact member variables and dependencies.

RULE 02

Specify Unity Packages Explicitly

Mention if your project uses the New Input System, Universal Render Pipeline (URP), NavMesh, or Addressables so Brody generates matching namespaces.

RULE 03

Ask for Zero GC in Update Loops

Explicitly prompt: "avoid LINQ, string concatenation, and per-frame heap allocations in Update". Brody will write cache-friendly high-performance C#.

RULE 04

Use Plan Mode for Large Systems

Switch to Plan mode before touching multi-script architectures. Let the Architect agent lay down file blueprints before generating code.

Battle-Tested Prompt Recipes

Modern Character Controller (New Input System)

Creates a clean, physics-compliant CharacterController or Rigidbody mover utilizing Unity’s UnityEngine.InputSystem.

Create a smooth 3D PlayerController using the new Input System (UnityEngine.InputSystem). Include sprint, jump, ground check via OverlapSphere, and coyote time. Expose serialized fields for moveSpeed and jumpForce.

ScriptableObject Item & Inventory System

Decoupled data-driven architecture. Items defined as assets, consumed by a generic inventory manager.

Design a ScriptableObject architecture for an RPG Item database. Create an ItemDefinition ScriptableObject with name, icon, stackLimit, and an abstract Use() method. Then write an InventoryManager component that handles stacking and drop logic.

Zero-Allocation Object Pooler

High-performance spawning system for bullets, projectiles, and particle VFX preventing garbage collection spikes.

Write a generic, thread-safe ObjectPool<T> where T : Component. Avoid any LINQ or per-frame GC allocations. Implement Get(), Release(), and prewarm capabilities. Add a test component SpawnerDemo demonstrating it.