# llGetAgentSize

*LSL function*

```lsl
vector vector llGetAgentSize(key avatar);
```

- `key avatar`: UUID of the avatar in the same region.

- Returns: `vector`
- Energy: 10

[ZERO_VECTOR](/constants/ZERO_VECTOR/) is returned if **avatar** is not in the region or if it is not an avatar.

Returns a [vector](https://wiki.secondlife.com/wiki/vector) that is an estimated size of the requested **avatar**.

```lsl title="How to use" frame="terminal"
vector result = llGetAgentSize(NULL_KEY);
```

## Caveats

- The returned vector is an estimate calculated from the avatar's current shape including shoes. x is a constant 0.45, y is a constant 0.60, z is the approximate total height of all avatar's bones, with an arbitrary amount added or subtracted based on the current shape's "Hover" setting. Reported height is constrained to the range 1.1 to 2.45 meters, and does not include animation or mesh bone offsets. [^wiki-3cc672]
  - Due to the shape Hover setting, and mesh and animation offsets, it is not possible to use this function to determine the rendered height of an avatar with any degree of confidence.
- As of Second Life Server 13.11.19.284082, the return value is the avatar's reported [bounding box](/functions/llGetBoundingBox/) - `<0.1, 0.1, 0.2>` when standing. (Avatar bounding boxes have historically been redefined with major physics upgrades.) An avatar's bounding box changes when an avatar sits, while [llGetAgentSize](/functions/llGetAgentSize/) is constant for as long as the shape does not change.

[^wiki-3cc672]: `llGetAgentSize` returns the same value as . See for defaults and limits.

## Examples

<details open>
<summary>Example 1</summary>

```lsl collapse={1-5, 11-22}
//A simple script that makes a box hover above the owner's head.
default
{
    state_entry()
    {
        key    owner = llGetOwner();
        vector pos   = llList2Vector(llGetObjectDetails(owner, [OBJECT_POS]), 0);
        vector agent = llGetAgentSize(owner);

    //  "pos" needs to be adjusted so it appears above the owner.
        pos.z += 0.5 + agent.z / 2;

    //  makes sure it found the owner, a zero vector evaluates as false
        if(agent)
            llSetPos(pos);
    }

    touch_start(integer num)
    {
        llResetScript();
    }
}
```

</details>

## 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

```lsl
if(llGetAgentSize(uuid)) {
    //uuid is an avatar in the region
} else {
    //uuid is not an avatar in the region
}
```

- `DEFAULT_AGENT_HEIGHT` in is 1.9. This will be the z value if an avatar's shape has [not loaded yet](https://wiki.secondlife.com/wiki/Ruth). It is possible but extremely rare to see a fully loaded avatar with this exact size, so:

```lsl
vector agentSize = llGetAgentSize(uuid);
if (agentSize.z == 1.9) {
    // avatar is probably Ruthed
}
```

## See also

### Functions

- [llGetObjectDetails](/functions/llGetObjectDetails/)
- [llGetBoundingBox](/functions/llGetBoundingBox/)
- [llGetAgentInfo](/functions/llGetAgentInfo/)
- [llRequestAgentData](/functions/llRequestAgentData/)

### Articles

- [Avatar body size](https://wiki.secondlife.com/wiki/Avatar_body_size)

---

*Source: [LlGetAgentSize](https://wiki.secondlife.com/wiki/LlGetAgentSize) on the Second Life Wiki. Content from the Second Life Wiki articles LlGetAgentSize (revision 1212795, 2022-11-17) and Template:LSL Function/avatar (revision 1179236, 2013-06-15), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llGetAgentSize/
