Difference between revisions of "LlGetPos"

From Second Life Wiki
Jump to navigation Jump to search
m (Altered an example.)
m (dede ;))
Line 5: Line 5:
|func_footnote
|func_footnote
|func_desc
|func_desc
|return_text=that is the the position of the task in [[Viewer coordinate frames#Region|region]] coordinates
|return_text=that is the position of the task in [[Viewer coordinate frames#Region|region]] coordinates
|spec
|spec
|caveats=*When called from the root of an attachment, returns the wearer's position. When called in any child prim, always returns that prim's region position.
|caveats=*When called from the root of an attachment, returns the wearer's position. When called in any child prim, always returns that prim's region position.

Revision as of 22:05, 19 June 2010

Summary

Function: vector llGetPos( );
0.0 Forced Delay
10.0 Energy

Returns a vector that is the position of the task in region coordinates

Caveats

  • When called from the root of an attachment, returns the wearer's position. When called in any child prim, always returns that prim's region position.

Examples

<lsl> default {

   touch_start(integer total_number)
   {
       // When touched, check the position of
       // the object, save it to "position",
       // then convert it into a string and
       // say it.
       vector position = llGetPos();
       llSay(0, (string)position);
   }

}</lsl><lsl> default {

   on_rez(integer param)
   {
       // Adding .x .y or .z after the vector name can be used to get the float value of just that axis.
       vector pos = llGetPos();
       float Z = pos.z; // <--- Like this.
       if(Z > 500.0)
       llOwnerSay("Oooh! I'm up high!");
   }
}</lsl>

See Also

Functions

•  llGetLocalPos Gets the prim local position
•  llGetPrimitiveParams Gets prim properties
•  llGetRootPosition Gets the root prims position
•  llSetPos Sets the prim position
•  llSetPrimitiveParams Sets prim properties
•  llSetLinkPrimitiveParams Sets linked prim properties

Deep Notes

Signature

function vector llGetPos();