Best Practices
How to structure your prompts for better results with Coplay
Coplay is designed to understand natural language, but structuring your requests in certain ways can help you get better and more accurate responses. This guide will help you communicate effectively with Coplay in Unity.
Request Types
Here are the main types of requests you can make to Coplay:
Questions
Best for when you need information or explanations.
Be specific with your questions. The more details you provide, the more tailored Coplay’s response will be to your situation.
Code Generation
Ask Coplay to write code for you by clearly stating what you need.
Code Analysis
Share your existing code for Coplay to analyze, explain, or improve.
Text Formatting for Better Results
Formatting your messages can help Coplay understand your needs better.
Technique | How to use it | Example |
---|---|---|
Be specific | Include details about your goal | ”Create a script that makes the camera follow the player with smooth damping and height offset” |
Use sections | Separate different parts of your request | ”Context: I’m making a 2D platformer. Question: How should I handle wall jumping?” |
Provide context | Explain your project setup | ”I’m using Unity 2022.1 with the URP rendering pipeline and need help with…” |
Effective Prompting Techniques
Step-by-Step Instructions
When you need Coplay to help with a complex task, break it down into steps:
Iterative Refinement
Start with a basic request and then refine it based on Coplay’s response:
Initial: “Create a player movement script”
Follow-up: “That’s good, but can you modify it to include sprinting when the Shift key is pressed?”
Code Examples
When sharing code with Coplay, use code blocks to make it easier to read:
Unity-Specific Terminology
Using accurate Unity terminology helps Coplay understand exactly what you’re asking:
General Term | Unity-Specific Term |
---|---|
3D object | GameObject |
Property | Component, Parameter, or Field |
Screen | Scene, Game View, or UI Canvas |
Code file | Script or MonoBehaviour |
Mathematical Expressions
Coplay can understand mathematical expressions, which is useful for game physics and graphics questions:
F = m \times aSample Conversation Flow
Here’s an example of an effective conversation with Coplay:
You: I’m trying to make an enemy that patrols between waypoints. Can you help me with the script?
Coplay: [Provides basic patrol script]
You: Thanks! Now how can I make the enemy detect and chase the player when they get close?
Coplay: [Builds on previous script to add player detection and chase behavior]
You: One last thing - how do I make the enemy return to patrolling when it loses sight of the player?
Coplay: [Completes the AI behavior with returning to patrol functionality]
Join Our Community
For more tips on effectively using Coplay, join our Discord community where you can share your experiences and learn from other users.