Difference between revisions of "LlGetAgentSize"

From Second Life Wiki
Jump to navigation Jump to search
m (Forgot to make it *show* the example...)
m
Line 12: Line 12:
//A simple script that makes a box hover above the owner's head.
//A simple script that makes a box hover above the owner's head.
default {
default {
    on_rez(integer i) {
    on_rez(integer i) {
          llSensor("", "", AGENT, 100000, 10000);
        llSensor("", llGetOwner(), AGENT, PI, 96);
    }
    }
    sensor(integer num) {
    sensor(integer num) {
          integer i = 0;
        vector where = llDetectedPos(0);
          while (i < num) {
        vector agent = llGetAgentSize(llGetOwner())/2;
              if (llDetectedKey(i) == llGetOwner()) {
        size += agent.z + <0,0,.5>;
                    vector where = llDetectedPos(i);
        llSetPos(where);
                    vector agent = llGetAgentSize(llGetOwner())/2;
    }
                    size += agent.z + <0,0,.5>;
    touch_start(integer num)
                    llSetPos(where);
    {
              }
        llResetScript();
              i++;
    }
          }
    }
}
}
</pre>
</pre>

Revision as of 10:35, 14 October 2007

Summary

Function: vector llGetAgentSize( key id );

Returns a vector that is the size of the requested avatar by id.

• key id

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 {
    on_rez(integer i) {
        llSensor("", llGetOwner(), AGENT, PI, 96);
    }
    sensor(integer num) {
        vector where = llDetectedPos(0);
        vector agent = llGetAgentSize(llGetOwner())/2;
        size += agent.z + <0,0,.5>;
        llSetPos(where);
    }
    touch_start(integer num)
    {
        llResetScript();
    }
}

Notes

This is a good way to test if an av is in the same region.

See Also

Functions

•  llGetBoundingBox
•  llGetAgentInfo
•  llRequestAgentData

Deep Notes

Search JIRA for related Issues

Signature

function vector llGetAgentSize( key id );