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.
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 |