> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coplay.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Prompt Guide

> Master the art of contextual prompting to receive precise, actionable results from Coplay, every time.

Effective communication is key to efficiency. By organizing your requests using a clear framework, you eliminate guesswork for **Coplay** and ensure the output—be it code, refactoring, or scene analysis—is always ready to use in your Unity project.

## The Optimal Prompt Formula

Every high-quality **Coplay** prompt should contain these three components:

### **1. Initial State (The Context)**

Define where you are starting. Include the necessary background, the existing issue, or the component you plan to modify.

> **Example:** "I have a third-person camera system using Cinemachine. The shake on impact is jarring."

<img src="https://mintcdn.com/coplay/r3tlrFdB2A71g3tz/images/Prompt-Guide/initialstate.png?fit=max&auto=format&n=r3tlrFdB2A71g3tz&q=85&s=82eb459d512ecd19d00500094377b319" alt="Initialstate Pn" width="624" height="126" data-path="images/Prompt-Guide/initialstate.png" />

### **2. Desired Outcome (The Goal)**

State exactly what you want the AI to deliver. Be specific about the functionality and the performance criteria.

> **Example:** "Refactor the camera script to smoothly ramp up and then immediately decay the shake effect over 0.75 seconds to feel more natural."

<img src="https://mintcdn.com/coplay/r3tlrFdB2A71g3tz/images/Prompt-Guide/refactor.png?fit=max&auto=format&n=r3tlrFdB2A71g3tz&q=85&s=ef59eb788aec0081bc7ed2be7de67fc6" alt="Refactor Pn" width="642" height="133" data-path="images/Prompt-Guide/refactor.png" />

### **3. Response Specifications (The Format)**

Tell **Coplay** where the change should happen and how the output should be structured.

> **Example:** "Provide the full C# script for **`@CameraControl.cs`** with the new logic, ensuring all public fields are serialized."

<img src="https://mintcdn.com/coplay/r3tlrFdB2A71g3tz/images/Prompt-Guide/TheFormat.png?fit=max&auto=format&n=r3tlrFdB2A71g3tz&q=85&s=7ca3e64818b21883708e60b0c5a8a0a5" alt="The Format Pn" width="641" height="136" data-path="images/Prompt-Guide/TheFormat.png" />

<Tip>
  A great prompt is always focused: **What is happening?** ➡️ **What should happen?** ➡️ **Where should it go?**
</Tip>

## Ensuring Project Focus

**Coplay** is project-aware, but you must direct its attention. Always reference specific files or objects to ensure the AI uses the correct context from your Unity project.

### **Always Reference Assets**

Avoid generalized language. Use file pinning (like the `@` symbol) or the in-editor selection tools to ensure **Coplay** is working on the correct scripts, prefabs, or scenes.

> **Effective:** "Please update the `PlayerAttack()` function inside **`@MeleeCombatSystem.cs`** to..." **Ineffective:** "Fix the player's attack script..."

<Warning>
  Asking **Coplay** to perform tasks like "Fix all compilation errors" will yield poor results. Be precise: "Address the specific type error in the **`@HealthBarUI.cs`** script."
</Warning>

***

## Dealing with Subpar Outputs

If **Coplay** generates an incorrect or incomplete response, resist the urge to debug it conversationally within the same thread. Since you cannot edit past prompts, this only creates confusion.

### **Know When to Reset**

If the AI misunderstands the core objective after the first attempt, it is always the most efficient choice to **Start a New Thread**.

* A clean start ensures the model is not polluted by the failed attempts and has a fresh contextual memory for your request.
* When starting the new thread, you may need to **re-pin your assets** and provide richer **Initial State** context to guide the AI correctly this time.

<Warning>
  **NEVER** attempt to debug or fix a massive, incorrect AI output by conversationally pointing out dozens of errors. **Start a New Thread instead.**
</Warning>
