From Second Life Wiki
Revision as of 07:11, 2 December 2012 by Kireji Haiku (Talk | contribs)

Jump to: navigation, search


Function: rotation llGetRootRotation( );

Returns a rotation that is the region rotation of the root prim of the object.


  • Returns an accurate facing for Avatars seated or in mouselook, but only a rough direction otherwise when called from an attached prim.
  • This function incorrectly (but usefully) returns the avatars region rotation when called in an attachment, use the following instead:

<lsl> // if called only from the root


// if called from in a linked object

   llList2Rot( llGetLinkPrimitiveParams( LINK_ROOT, [PRIM_ROT_LOCAL] ), 0 );

// this alternative works correctly in all scenarios

   llList2Rot( llGetLinkPrimitiveParams( !!llGetLinkNumber(), [PRIM_ROT_LOCAL] ), 0 );


All Issues ~ Search JIRA for related Bugs


Simple example to set region rotation of child prim in unattached link set <lsl> default {

   //Rotate 45 degrees about Y-axis
   rotation globalRot = llEuler2Rot(<0.0, 45.0, 0.0> * DEG_TO_RAD);
   llSetLocalRot(globalRot / llGetRootRotation());




In an attached object, returns region rotation of avatar NOT of the object's root prim. See special cases of rotation.

See Also

Deep Notes

All Issues

~ Search JIRA for related Issues
   Improve accuracy of avatar's visible rotation


function rotation llGetRootRotation();