function
Function syntax
llRezObject(string item,// Name of the object in the prim's inventory to rez.vector pos,// Position vector in region coordinates where the center of the object will be placed.vector vel,// Initial velocity vector (maximum magnitude ~200m/s).rotation rot,// Initial rotation of the rezzed object.integer start_param// Start parameter passed to the rezzed object'son_rezevent (accessible viallGetStartParameter).
);- Delay
- 0.1 s
- Energy
- 200
Instantiates the named inventory object with the bounding box centered at pos with velocity vel and rotation rot, passing param as the on_rez start parameter. The vel parameter is ignored if the rezzed object is non-physical.
Instantiate inventory object at pos with velocity vel and rotation rot with start parameter param
The root of inventory is not at pos but the center of inventory is.
To have the root prim at pos use llRezAtRoot instead.
llRezObject("", ZERO_VECTOR, ZERO_VECTOR, ZERO_ROTATION, 0);Caveats
Section titled “Caveats”- Silently fails to rez
inventory(to have it’s geometric center at pos) if pos is too far from the geometric center of the object trying to rezinventory. - If your script is mysteriously failing to rez things, make sure you haven’t (say) written “
<0.0,0.0,1.0>” for the pos parameter rather than (say)llGetPos() + <0.0,0.0,1.0>”. - When scripting attachments meant to rez objects, remember that when used in the root of an (
attached) attachmentllGetPosdoesn’t return the position of the attachment but instead returns the position of the avatar’s bounding box geometric center. ReadllGetPosand llParticleSystem Caveats for more information. - If the object is unattached and the owner of the object does not have copy permission on
inventory, the object will no longer be present in inventory after it is rezzed (so another attempt to rez (the same object) will fail); if the owner does have copy permission, then a copy is rezzed, and the originalinventoryremains in inventory. - If the object is attached and the owner of the object does not have copy permission on
inventory, an error is shouted onDEBUG_CHANNEL: “Cannot rez no copy objects from an attached object.” - Silently fails if you don’t have offline building rights on the land. To have the right, your objects needs to either:
- Be on land you own yourself.
- Be on land where anyone is allowed to build, e.g. a sandbox.
- Be deeded to the group that owns the land.
- Be set to the same group that owns the land and the land have the parcel flag ‘allow group to build’ set.
- The group role “Always allow ‘Create Objects’” will only work to override this when you are online, in the region, or have a child agent in the region. See SVC-3145 in the Issues subsection of Deep Notes for more information.
- See
object_rezfor examples on how to establish communications between the rezzing object and the new prim.
Examples
Section titled “Examples”Example 1
default{ touch_start(integer param) { llRezObject("Object", llGetPos() + <0.0,0.0,1.0>, <0.0,0.0,0.0>, <0.0,0.0,0.0,1.0>, 0); }}Example 2
16 collapsed lines
// Rez an object on touch, with relative position, rotation, and velocity all described in the rezzing prim's coordinate system.string object = "Object"; // Name of object in inventoryvector relativePosOffset = <2.0, 0.0, 1.0>; // "Forward" and a little "above" this primvector relativeVel = <1.0, 0.0, 0.0>; // Traveling in this prim's "forward" direction at 1m/srotation relativeRot = <0.707107, 0.0, 0.0, 0.707107>; // Rotated 90 degrees on the x-axis compared to this priminteger startParam = 10;
default{ touch_start(integer a) { vector myPos = llGetPos(); rotation myRot = llGetRot();
vector rezPos = myPos+relativePosOffset*myRot; vector rezVel = relativeVel*myRot; rotation rezRot = relativeRot*myRot;
llRezObject(object, rezPos, rezVel, rezRot, startParam); }}Maximum rez distance
- The
distancescales with the size of the object the script is in. - The formula is
10 + llVecMag(llGetScale()) * 0.5 - The
distancemeasured is between thecenterof the rezzingprimand thecenterof theprimthat is rezzed. - The tests did not include rezzing from or the rezzing of link_set objects.
- A
0.01meter cube could rez just beyond10.0meters away. - A
10.0meter cube could rez just beyond18.66meters away. - A
32.0meter cube could rez just beyond37.71meters away. - A
64.0meter cube could rez just beyond65.42meters away.
Known issues
Section titled “Known issues”From the issue templates included by the wiki article:
- SVC-3145 (bug): group ROLE permissions only work for scripted rez when owner is online
- SVC-6578 (bug): llRezObject at wrong position when rezzing a linkset that was previously rotated in-world.
- SVC-6686 (nf): parcel build permissions needs whitelist
- SCR-485 (nf): llRezTempObject() - for temporarily rezzing objects
See also
Section titled “See also”Functions
Section titled “Functions”llRezObjectWithParams— Modern alternative with more parameters.llRezAtRoot— Rezzes the object at the requested positionllGetStartParameterllGodLikeRezObject- LlGetParcelFlags — Test if the parcel allows this script to rez
Events
Section titled “Events”object_rez— triggered when this object rezzes an object from inventory
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.