Don't click here unless you want to be banned.

LSL Wiki : llSetRot

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl814.us.archive.org
llSetRot(rotation rot)

If an object is non-physical, sets the rotation to rot. In a linked set, this will be root-relative.
If the object is a child in a linked physical set, this function will also work (see ChildRotation).

Like llSetPos, use llSetRot to rotate an attachment.

For rotation on physical tasks see llRotLookAt.

For the translational analog, see llSetPos.

To set the rotation of a child prim, use llSetLocalRot.

Beginners are often confused about the difference between this function and llTargetOmega. llTargetOmega makes the object SPIN with the specified angular velocity. llSetRot just turns it ONCE to face in a particular direction.

Note: This function delays the script for 0.2 seconds.

To determine the rotation of an object, use llGetRot.
To simultaneously set many object parameters including rotation, and position, use llSetPrimitiveParams.

Q: Does llSetRot work on attachments?
A: Yes.

Q: I need to set both the rotation and position of a prim at once. My object looks jerky and weird without it.
A: You want llSetPrimitiveParams.

This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | Dynamics | Rotation
Comments [Hide comments/form]
:sigh: Yet another misreference to llLookAt. The physical equivelant to llSetRot is llRotLookAt :-p
-- ChristopherOmega (2004-02-19 19:00:43)
Yay stupid LSL naming schemes!
-- GuzarFonzarelli (2004-02-19 19:17:57)
llSetRot() always rotates an object around its center. Some people want to rotate an object around an offset / arbitrary center-point. This can be accomplished by multiplying a vector (the offset from current position) by a rotation; then adding the current position to the result. Call llSetPos() with the final vector, and voila! You can find an example function that does this at: http://forums.secondlife.com/showthread.php?t=33104
-- TreadWhiplash (2005-01-16 14:47:09)
Some trouble shooting notes:

llSetRot() will not actually rotate the object unless the object has physics unset, as implied by the fragment "If an object is NonPhysical..." above.

If it still doesn't rotate your object, you might check to see if you have locked rotation along the x, y, or z axis.

All of these can be modified through llSetStatus() using either STATUS_PHYSICS or STATUS_ROTATE_X, STATUS_ROTATE_Y, and STATUS_ROTATE_Z, as appropriate.
-- FroglegHornpipe (2005-04-24 18:44:41)
I think the page is broken. I tried adding an extra ", but the comments and everything are all still olive. X_x
-- CirrMarat (2005-08-31 06:18:02)
Another troubleshooting tip:
If your object does not appear to be rotating when changing by a small angle (~1-3 degrees), it's because your client is not getting the updated rotation. Only when the new rotation exceeds some minimum amount (4 or 5 deg?) will it be updated on your client. One way to force a client-side update before then is to change the object's properties, like color or alpha. Try changing the color by some tiny amount for each llSetRot call.
-- KankerGreenacre (2006-04-29 00:39:46)
Attach a comment to this page: