Skip to content
lsl.devlsl.devLSL Dev

llGetRootPosition

function
Function syntax
vector llGetRootPosition();
Returns
vector
Energy
10

Returns a vector representing the position (in region coordinates) of the root prim of the linkset containing the script.

Returns a vector that is the region position of the root object of the object script is attached to

How to use
vector result = llGetRootPosition();
Example 1
default{
touch_start( integer vIntTouched ){
string vStrMessage = "The prim with this script is ";
if (llGetPos() != llGetRootPosition()){
vStrMessage += "NOT ";
}
llSay( PUBLIC_CHANNEL, vStrMessage + "centered on the root prim." );
}
}
//-- there is no llSetLocalPos, this adds the functionality
//-- to match llGetLocalPos() in a child prim
fSetLocalPos( vector vPosOffset ){
llSetPos( llGetRootPosition() + vPosOffset );
}
//-- this will move a root prim by the offset, or set the
//-- position of a child prim relative to the root.
  • llGetLocalPos — Gets the child prims position relative to the root
  • llGetPos — Gets the prims global position
  • llSetPos — Sets the prims global position
Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.

From the Second Life Wiki

Community documentation adapted from LlGetRootPosition, by Linden Research, Inc. and contributing residents.View contributors and history.

Imported wiki revision:

Licensed under CC BY-SA 3.0. Last wiki edit: .Formatting and links have been adapted for this site; API metadata follows the LSL definitions.