Collision Shape

physics.collision_shape.create

Shared

Creates a new collision shape instance and attaches it to a physics body or area

Syntax

local instance = physics.collision_shape.create(
    body
)

Parameters

TypeNameDescription
objectbodyPhysics body or area instance to attach the shape to

Returns

TypeNameDescription
objectinstanceCreated collision shape instance

Examples

Create a collision shape instance
local body = physics.rigid.create()
local entity = physics.collision_shape.create(body)

entity:set_shape_box({1, 1, 1})

On this page