LlSetBuoyancy
From Second Life Wiki
| LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: llSetBuoyancy( float buoyancy );| 122 | Function ID |
| 0.0 | Forced Delay |
| 10.0 | Energy |
Sets the buoyancy of the task or object. Requires physics to be enabled.
| • float | buoyancy |
if (buoyancy == 0.0) disables
if (buoyancy < 1.0) sinks
if (buoyancy == 1.0) floats
if (buoyancy > 1.0) rises
Caveats
- Wind can cause the prim to drift. (server 1.38.4 this appears not to be true)
- Unlike some other characteristics, this is cancelled if the script that set buoyancy is removed from the prim.
- This function cannot be used to set relative levels of buoyancy in parts of a linked object e.g. to simulate a helium balloon weighted by its string. The most recent call of
llSetBuoyancyin any child prim appears to set the global buoyancy level for the object. - This function eats energy to keep the object floating. Large objects may not be able to supply enough energy to keep the object floating.
Examples
Makes an object float up slowly (e.g. a red balloon)
default { state_entry() { llSetStatus(STATUS_PHYSICS, TRUE); llSetBuoyancy(1.05); } }
This article wasn't helpful for you? Maybe the related article at the LSL Wiki is able to bring enlightenment.

