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
vector result = llGetRootPosition();Examples
Section titled “Examples”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." ); }}Helper functions
Section titled “Helper functions”//-- there is no llSetLocalPos, this adds the functionality//-- to match llGetLocalPos() in a child primfSetLocalPos( 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.See also
Section titled “See also”Functions
Section titled “Functions”llGetLocalPos— Gets the child prims position relative to the rootllGetPos— Gets the prims global positionllSetPos— 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.