llSetBuoyancy

From Second Life Wiki
Revision as of 04:34, 3 June 2009 by Ppaatt Lynagh (talk | contribs) (Changed spelling to 'affect' from 'effect', since to affect an object is to have an effect on it, whereas to effect an object would be more like to rez it.)
Jump to navigation Jump to search

Summary

Function: llSetBuoyancy( float buoyancy );

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.
  • Unlike some other characteristics, this is cancelled if the script that set buoyancy is removed from the prim.
  • This function eats energy to keep the object floating. Large objects many not be able to supply enough energy to keep the object floating.
All Issues ~ Search JIRA for related Bugs

Examples

Makes an object float up slowly (e.g. a red balloon)<lsl>default {

   state_entry()
   {
       llSetStatus(STATUS_PHYSICS, TRUE);
       llSetBuoyancy(1.05);
   }
}</lsl>

Notes

Often used to make an object look like gravity does not affect it.

Deep Notes

Search JIRA for related Issues

Signature

function void llSetBuoyancy( float buoyancy );