cocos_create_physics_material
Create physics material assets for Cocos Creator colliders with customizable friction and bounce properties to define object interactions in games.
Instructions
Create a cc.PhysicsMaterial (.pmat) asset. Returns {path, rel_path, uuid}.
Bind to a collider via
cocos_set_uuid_property(collider_id, "_material", <uuid>).
Defaults match engine: friction=0.6, restitution=0 (no bounce). For bouncy materials set restitution 0.3-0.9; for ice set friction 0.02.
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>",
"material_name": "<material_name>"
},
"name": "cocos_create_physics_material"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes | ||
| material_name | Yes | ||
| friction | No | ||
| rolling_friction | No | ||
| spinning_friction | No | ||
| restitution | No | ||
| rel_dir | No |