LlGetAgentSize
From Second Life Wiki
| Languages: |
English • Deutsch • Español • ελληνικά • Français • עברית • Italiano • 日本語 • 한국어 • Nederlands • Magyar • Norsk • Dansk • Svenska • Türkçe • Polski • Português • Русский • украї́нська • 中文(简体) • 中文(繁體) |
| Volunteer translated pages are linked in blue, Google translated pages are linked in grey. Learn how to provide volunteer translations. | |
| LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Tutorials |
Contents |
Summary
Function: vector llGetAgentSize( key id );| 218 | Function ID |
| 0.0 | Delay |
| 10.0 | Energy |
Returns a vector that is the size of the requested avatar by id.
| • key | id | – | avatar UUID that is in the same region |
ZERO_VECTOR is returned if id is not in the region or if it is not an avatar.
Examples
//A simple script that makes a box hover above the owner's head. default { state_entry(integer i) { key owner = llGetOwner(); vector pos = llList2Vector(llGetObjectDetails(owner, [OBJECT_POS]),0); vector agent = llGetAgentSize(owner); pos.z += 0.5 + agent.z / 2;//"pos" needs to be adjusted so it appears above the owner. if(agent)//makes sure it found the owner, a zero vector evaluates as false llSetPos(pos); } touch_start(integer num) { llResetScript(); } }
Notes
- This function is a good way to quickly test...
- if an avatar is in the same region.
- if a UUID known to be in the region is an avatar.
To use this function to test either case use as follows
if(llGetAgentSize(uuid)) { //uuid is an avatar in the region } else { //uuid is not an avatar in the region }
- The returned vector holds the size of the avatar's bounding box[1], of which only the height (z) varies. Width (x) and depth (y) are constant. (0.45m and 0.6m respectively).
Deep Notes
Issues
Search JIRA for related IssuesFootnotes
- ^ In fact the returned height is much smaller than the bounding box height. To get the actual avatar height in meters (counting shoes, and with a +/-3cm precision) apply a factor of 1.125
This article wasn't helpful for you? Maybe the related article at the LSL Wiki is able to bring enlightenment.

