Difference between revisions of "LlSetBuoyancy"

From Second Life Wiki
Jump to navigation Jump to search
m
m (Added note to caveat.)
Line 8: Line 8:
|func_footnote=if ('''buoyancy''' == 0.0) disables<br/>if ('''buoyancy''' < 1.0) sinks <br/>if ('''buoyancy''' == 1.0) floats <br/>if ('''buoyancy''' > 1.0) rises
|func_footnote=if ('''buoyancy''' == 0.0) disables<br/>if ('''buoyancy''' < 1.0) sinks <br/>if ('''buoyancy''' == 1.0) floats <br/>if ('''buoyancy''' > 1.0) rises
|spec
|spec
|caveats=*[[llWind|Wind]] can cause the prim to drift.
|caveats=*[[llWind|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.
*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 may not be able to supply enough energy to keep the object floating.
*This function eats [[energy]] to keep the object floating. Large objects may not be able to supply enough energy to keep the object floating.

Revision as of 20:05, 9 May 2010

Summary

Function: llSetBuoyancy( float buoyancy );
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 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)<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

Signature

function void llSetBuoyancy( float buoyancy );