You are here: Lua Scripting Resources eGuide > Lua Scripting API Reference Guide > Physics Library > sleepWithGroup

19.4.32 sleepWithGroup

self = physics.Body:sleepWithGroup( [group] )

Parameter

Type

Description

self

in physics.Body

The input Body

group

in physics.Body

A sleeping body. If this parameter is not supplied, a new group is created

bool

out physics.Body

The input Body is returned as the output

Puts the Body to sleep and adds it to a group of other sleeping bodies.

Info

See http://chipmunk-physics.net/release/Chipmunk-5.x/Chipmunk-5.3.4-Docs/ for an explanation of this routine.

Note

The body must be added to a Space before it can be put to sleep.

Calling this function within a query or callback is not allowed.

This routine will raise an exception if group is not sleeping.

Introduced in platform.apiLevel = '2.0'