vector llGetAgentSize( key avatar );
Forced delay: 0.0 seconds. Energy: 10.0.
ZERO_VECTOR is returned if avatar is not in the region or if it is not an avatar.
Returns a vector that is an estimated size of the requested avatar.
//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();
}
}
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
}
DEFAULT_AGENT_HEIGHT in indra/llcommon/indra_constants.h:96 is 1.9. This will be the z value if an avatar's shape has not loaded yet. It is possible but extremely rare to see a fully loaded avatar with this exact size, so:vector agentSize = llGetAgentSize(uuid);
if (agentSize.z == 1.9) {
// avatar is probably Ruthed
}