Don't click here unless you want to be banned.
LSL Wiki :
llAttachToAvatar
HomePage
::
PageIndex
::
RecentChanges
::
RecentlyCommented
::
UserSettings
:: You are crawling22.us.archive.org
**##llAttachToAvatar([[integer]] [[attachment]])##** [[attachment Attaches]] the [[script scripted]] [[object]] at the specified **##attachment##** point to the [[AgentAndAvatar avatar]] it has ##[[scriptpermissions PERMISSION_ATTACH]]## for. Even though [[user users]] other than the owner can grant this [[permissions permission]], attaching to them will fail with the message "##Script trying to attach to someone other than owner!##". An object must have permission to attach itself. [[call Call]] ##[[llGetPermissions]]## to see if the object has the ##PERMISSION_ATTACH## permission; if it doesn't, ##[[llRequestPermissions]]## must first be called to request permissions from the [[user]]. The ##[[attach]]## [[event]] is called with the avatar's [[key]]. **Notes:** -Once an object is attached to the avatar, certain script functionality is disabled. See [[attachment]] for more details. -If there is already an attachment at the attachment point, it will be detached and replaced with the new one. -The attachment points are (usually) centered on the body part. If an object has not been attached before, it attaches at <0,0,0> [[offset]] from the attachment point. If the object has been attached before, it remembers its last attachment offset. -Attachment points are relative to the object's skeleton, not its [[face surface]]. This can cause some attachments to look weird. ##ATTACH_RPEC## and ##ATTACH_LPEC## are examples of attachment points with high levels of surface/skeleton drift. The attachment [[parameter]] can be one of the following [[constants]] (also [[integer integers]]): |||c **Constant** || **Value** || **Comment** || || ? ||0|| attach to last used attachment spot, like when you select Wear (default is right hand) || || ##ATTACH_CHEST## ||1|| chest/sternum - ##ATTACH_LBOOBIE## and ##ATTACH_RBOOBIE## don't exist, though there's ##ATTACH_RPEC## and ##ATTACH_LPEC## || || ##ATTACH_HEAD## ||2|| head || || ##ATTACH_LSHOULDER## ||3|| left shoulder || || ##ATTACH_RSHOULDER## ||4|| right shoulder || || ##ATTACH_LHAND## ||5|| left hand || || ##ATTACH_RHAND## ||6|| right hand || || ##ATTACH_LFOOT## ||7|| left foot || || ##ATTACH_RFOOT## ||8|| right foot || || ##ATTACH_BACK## ||9|| back || || ##ATTACH_PELVIS## ||10|| pelvis || || ##ATTACH_MOUTH## ||11|| mouth || || ##ATTACH_CHIN## ||12|| chin || || ##ATTACH_LEAR## ||13|| left ear || || ##ATTACH_REAR## ||14|| right ear || || ##ATTACH_LEYE## ||15|| left eye || || ##ATTACH_REYE## ||16|| right eye || || ##ATTACH_NOSE## ||17|| nose || || ##ATTACH_RUARM## ||18|| right upper arm || || ##ATTACH_RLARM## ||19|| right lower arm || || ##ATTACH_LUARM## ||20|| left upper arm || || ##ATTACH_LLARM## ||21|| left lower arm || || ##ATTACH_RHIP## ||22|| right hip || || ##ATTACH_LHIP## ||23|| left hip || || ##ATTACH_RULEG## ||24|| right upper leg || || ##ATTACH_RLLEG## ||25|| right lower leg || || ##ATTACH_LULEG## ||26|| left upper leg || || ##ATTACH_LLLEG## ||27|| left lower leg || || ##ATTACH_BELLY## ||28|| belly/stomach/tummy|| || ##ATTACH_RPEC## ||29|| right pectoral || || ##ATTACH_LPEC## ||30|| left pectoral - as noted above, ##ATTACH_RPEC## and ##ATTACH_LPEC## don't always //look// like they're attached to the right and left side of the chest, and will appear to float around a little. || || ? ||31|| HUD Center 2 || || ? ||32|| HUD Top Right || || ? ||33|| HUD Top || || ? ||34|| HUD Top Left || || ? ||35|| HUD Center || || ? ||36|| HUD Bottom Left || || ? ||37|| HUD Bottom || || ? ||38|| HUD Bottom Right ||| **Q:** ''Does this have any purpose when attaching from [[inventory]] or only for attaching on a [[touch]] event or similar thing? Seems like going from inventory doesn't require ##PERMISSION_ATTACH## either.'' **A:** ''##llAttachToAvatar## is used for objects that already exist in-[[world]]. Objects in your inventory can be thought of as being in an inert, suspended state. They don't actually "exist" until you [[rez]] them.'' **Q:** ''If I attach an object from inventory, will it have ##PERMISSION_ATTACH## right away, or do I have to request it? And what about an object rezzed by an attached object? (For example, if I need to have an attached object rez a HUD element.)'' **A:** ''You always must request permissions, but some permissions are auto-granted upon request for attachment or sit.'' [[BlindWanderer BW]] Example: %%(lsl) default { touch_start(integer num_detected) { llRequestPermissions(llDetectedKey(0), PERMISSION_ATTACH); } run_time_permissions(integer perm) { if (perm & PERMISSION_ATTACH) { llAttachToAvatar(ATTACH_RHAND); } } } %% **Q:** ''Can an attachment go directly to another point on the body? i.e. from left hand to chest?'' **A:** ''No.'' ---- [[functions Functions]] | [[AgentAndAvatar Agent/Avatar]] | [[attachment Attachment]]
Valid XHTML 1.0 Transitional
::
Valid CSS
:: Powered by
WakkaWiki 0.1.2