User:Toy Wylie/RLV Documentation/setrot

From Second Life Wiki
< User:Toy Wylie‎ | RLV Documentation
Revision as of 15:02, 7 July 2010 by Toy Wylie (talk | contribs) (first draft)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


@setrot

Type

General

Implemented

Implemented since RLV version 1.17

Usage

@setrot:<angle>=force

Purpose

Rotates the user's avatar to face the angle given in radians. An angle of 0.0 means "Face North". Keep in mind that an avatar will only rotate if the difference is big enough from the current rotation. The threshold is around 6° to 10°.


See Also

Example

<lsl>default

{

   touch_start(integer num)
   {
       if(llDetectedKey(0)==llGetOwner())
       {
           float angle=llFrand(TWO_PI);
           llOwnerSay("@setrot:"+(string) angle+"=force");
           llOwnerSay("You are now facing "+(string) ((integer) (angle*RAD_TO_DEG))+"° from the north.");
       }
   }
}</lsl>