LlGetAgentSize

From Second Life Wiki

(Redirected from LSL llGetAgentSize)
Jump to: navigation, search

Contents

Description

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


The agent id must be in the same region as the requesting object, ZERO_VECTOR is returned if not.

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 is a good way to test if an av is in the same region.
  • The returned vector holds the size of the avatar's bounding box, of which only the height (z) varies. Width (x) and depth (y) are constant. (0.45m and 0.6m respectively).

See Also

Personal tools