STATUS PHYSICS
| LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Description
Constant: integer STATUS_PHYSICS = 0x1;The integer constant STATUS_PHYSICS has the value 0x1
This property if TRUE allows that the object is subject to and can offer physical interactions and forces.
Caveats
Related Articles
Constants
|
Functions
| • | llSetStatus | |||
| • | llGetStatus |
Examples
Simple script to turn on and off the physics of an object. <lsl>default {
state_entry()
{
llSetTimerEvent(llFrand(10) + 5.0); // Set a random time in seconds between 5 and 15
}
timer()
{
if(!llGetStatus(STATUS_PHYSICS)) // Check the physical status is non-phys
{
llSetStatus(STATUS_PHYSICS, TRUE); // Set the object physical
llMoveToTarget(llGetPos() + <0.0,0.0,10.0>, 1.0); // Move to a point 10 meters above the present position
}
else // If physical
{
llSetStatus(STATUS_PHYSICS, FALSE); // Set the object non-phys
llSetTimerEvent(0.0); // Stop the timer
}
}
}</lsl>