llRezObject(string name, vector pos, vector vel, rotation rot, integer param)
Rez an object considering the centre of its bounding box as reference.
WARNING
This function has a bug that affects the position of the rezzed object when the rotation of the rezzed object changes, and its use is discouraged. Use llRezAtRoot
instead.
The name of the object to rez, as a string (must be in the prim's inventory).
Position (as a vector in region coordinates) where to place the centre of the bounding box of the rezzed object, in metres.
If the object to rez is physical, this vector indicates the initial velocity it should have, in metres per second. If it's not physical, this parameter is ignored.
The rotation that the object will have when rezzed.
Parameter (an integer) to pass to the child. The child can read this parameter using llGetStartParameter
() or the param
of the on_rez event.
rot
is not taken into account when calculating the position of the root of the rezzed object, but the original rotation when the object was taken is (bug SVC-6578). If the rez rotation rot
is different from the rotation of the object when it was taken, this bug will happen, resulting in the centre of the bounding box not ending up in the specified position pos
.// Rez an object called Bullet 1m away from the current position in the X direction, // with velocity of 20 m/s in the X direction and no rotation, and with a parameter of 1 llRezObject("Bullet", llGetPos() + <1,0,0>, <20, 0, 0>, ZERO_ROTATION, 1);
default { state_entry() { llRezObject(TODO); } }
llRezAtRoot
is similar, but the pos
parameter indicates the final position of the root prim, regardless of the bounding box.