Skip to content

Getting Started with ZenCoder

ZenCoder is designed to feel effortless. No boilerplate. No extra setup. Just attach, write, and run.

Here’s how to begin in seconds:

Add ZenCoder to Any GameObject

You can add ZenCoder just like any Unity component — no special setup needed.

  • Option 1 – Right-Click Attach
    In the Hierarchy, right-click on any GameObject → Attach ZenCoder**

  • Option 2 – Inspector Add Component
    Select your GameObject → click “Add Component” → search for ZenCoder

That’s it. The IDE panel will appear instantly in the Inspector.


Write Code Directly in the Inspector

When you add ZenCoder, you’ll see a live code editor ready to go — with syntax highlighting, line numbers, and full IntelliSense.
The editor lets you write C# directly inside the Inspector and execute it in real time.

Example:

public class ZenCoder {
    public void Start() {
        // Initialization logic
        Debug.Log("ZenCoder started");
    }

    public void Update(float deltaTime) {
        // Frame-based logic
        transform.Rotate(Vector3.up * deltaTime * 90f);
    }

    public void OnDrawGizmos() {
        // Draws gizmos both in Edit and Play Mode
        Gizmos.color = Color.cyan;
        Gizmos.DrawWireSphere(transform.position, 0.5f);
    }
}

✅ Supports syntax highlighting, line numbers, and smart auto-completion
✅ Errors appear in the ZenCoder status bar and highlight directly in the editor
✅ Runs instantly — no recompilation or Play Mode restarts
✅ Scripts are saved per-component for a clean, modular workflow

ZenCoder supports a wide range of Unity lifecycle methods, from initialization (Awake, Start, OnEnable) to rendering (OnDrawGizmos, OnRenderObject), physics (OnCollisionEnter, OnTriggerStay2D), and more.

See the full reference here: Lifecycle Methods Reference →


Target Components Contextually

Each ZenCoder instance lets you select a target component from the same GameObject.

  • The special target keyword gives you full access to its fields, properties, and methods

  • You’ll get IntelliSense suggestions and deep reflection support

Example:

target.health -= 10;
target.enabled = false;
Debug.Log(target.name);

Manage Everything in ZenCoder Control Center

To monitor and manage all active scripts:

→ Go to Tools > DivinityCodes > ZenCoder - Control Center

The Control Center gives you:

  • A full list of GameObjects using ZenCoder
  • Target component overview
  • Status indicators (Running / Stopped)
  • One-click ping, select, or stop