cocos_scaffold_spawner
Generate spawner scripts for Cocos Creator games to automatically instantiate prefabs on timers or player proximity triggers with configurable limits and callbacks.
Instructions
Generate Spawner{Kind}.ts — instantiate @property prefab on a trigger.
"time" — every @property interval s, up to @property maxActive concurrent. Jitters spawn position within @property spawnBoxSize half-extents. Over cap: despawn oldest (destroy + shift queue). "proximity" — spawn when @property player is within @property triggerRadius, respecting @property cooldown seconds and @property maxActive cap.
Both variants parent spawned nodes under this.node.parent
(NOT the spawner itself — inheriting the spawner's transform is
usually wrong) and fire optional @property onSpawn callback post-
addChild so game code can attach health, patrol targets, etc.
Default rel_path: SpawnerTime.ts / SpawnerProximity.ts.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project_path": "<project_path>"
},
"name": "cocos_scaffold_spawner"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes | ||
| kind | No | time | |
| rel_path | No |