Provide useful context
“Help me fix it” omits the goal and evidence. Pasting the whole repository can bury the relevant details. Useful context helps Chat find the code and judge whether a change works.
What to include
- Goal: for example, add one point when the target is clicked.
- Entry scene:
assets/main.scene. - Relevant files:
assets/main.sceneandassets/scripts/ClickGame.ts; for image problems, includeassets/resources/images/pink-target.pngand its.metafile. - Key objects:
GameController,Canvas/ScoreCard/ScoreLabel,Canvas/Target, andCanvas/ResetButton.TargetSpritedisplays the image underTarget; the click listener is attached toTarget. - Component references: on
GameController'sClickGamecomponent,Score Labelpoints to theScoreLabelLabel component, whileTargetandReset Buttonpoint to their nodes. State whether any reference is empty. - Observed behavior: what you actually saw and the first error.
- Expected result: the score changes from 0 to 1, then returns to 0 on reset.
- Constraints: the project's COCOS version, no new dependencies, and no edits to generated directories.
Pink Demo context template
text
Project: Pink Demo, COCOS Creator 3.8.8.
Scene: assets/main.scene.
Script: assets/scripts/ClickGame.ts.
Observed: clicking Target leaves "Score: 0".
Expected: "Score: 1", then the next fixed position.
Check GameController bindings: scoreLabel, target, resetButton; then onEnable/onDisable and score updates.
Report missing-reference errors. Preserve node names, UUIDs, dependencies, and scene UI. Propose a minimal fix.Replace the sample observation with your actual result. Include the current Inspector bindings and the first Console error. An empty Problems panel does not prove that the game runs correctly.
When to add more information
Add full logs, related callers, or asset metadata when the first analysis cannot locate the issue. Do not send account tokens, signing certificates, user data, or entire environment-variable files to Chat.