self:get_colliding_bodies

Client

Retrieves a list of rigid bodies of the same type currently colliding with this rigid body


Syntax

local bodies = self:get_colliding_bodies()

Parameters

No parameters are accepted by this function

Returns

TypeNameDescription
tablebodiesArray of colliding rigid body instances

Examples

Get colliding bodies of a rigid body
local entity = physics.rigid.create()

for i, body in ipairs(entity:get_colliding_bodies()) do
    core.engine.print("info", "Rigid body colliding bodies:", body)
end

On this page