R3d.Body:setIsAllowedToSleep: Difference between revisions

From GiderosMobile
m Text replacement - "<source" to "<syntaxhighlight"
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 6: Line 6:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
r3d.Body:setIsAllowedToSleep(allowed)
r3d.Body:setIsAllowedToSleep(allowed)
</source>
</syntaxhighlight>
 
The sleeping technique is used to disable the simulation of resting bodies. By default, the bodies are allowed to sleep when they come to rest.


=== Parameters ===
=== Parameters ===
'''allowed''': (boolean) either true or false (default is '''true''')<br/>
'''allowed''': (boolean) either true or false, '''default true'''<br/>


=== Example ===
=== Example ===
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
// This rigid body cannot sleep
ship.body:setIsAllowedToSleep(false)
ship.body:setIsAllowedToSleep(false)
</source>
</syntaxhighlight>


{{R3d.Body}}
{{R3d.Body}}

Latest revision as of 09:58, 18 December 2025

Available since: Gideros 2019.10
Class: R3d.Body

Description

Allows or disallows a body to sleep.

r3d.Body:setIsAllowedToSleep(allowed)

The sleeping technique is used to disable the simulation of resting bodies. By default, the bodies are allowed to sleep when they come to rest.

Parameters

allowed: (boolean) either true or false, default true

Example

// This rigid body cannot sleep
ship.body:setIsAllowedToSleep(false)