Difference between revisions of "LlGetAgentSize"
Jump to navigation
Jump to search
(It's a great example but at this point in time it's antiquated. Much easier to use llGetObjectDetails, probably should use it instead of llGetAgentSize too but that would spoil all the fun.) |
m |
||
Line 16: | Line 16: | ||
vector pos = llList2Vector(llGetObjectDetails(owner, [OBJECT_POSITION]),0); | vector pos = llList2Vector(llGetObjectDetails(owner, [OBJECT_POSITION]),0); | ||
vector agent = llGetAgentSize(owner); | vector agent = llGetAgentSize(owner); | ||
pos.z += 0.5 + agent.z / 2; | pos.z += 0.5 + agent.z / 2;//"pos" needs to be adjusted so it appears above the owner. | ||
llSetPos(pos); | if(agent)//makes sure it found the owner, a zero vector evaluates as false | ||
llSetPos(pos); | |||
} | } | ||
touch_start(integer num) | touch_start(integer num) | ||
{ | { |
Revision as of 08:02, 12 November 2007
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: vector llGetAgentSize( key id );218 | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
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.
Caveats
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_POSITION]),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.
See Also
Functions
• | llGetBoundingBox | |||
• | llGetAgentInfo | |||
• | llRequestAgentData |