Difference between revisions of "LlGetAgentSize"
Jump to navigation
Jump to search
m |
m (Edited a few scripting errors) |
||
Line 21: | Line 21: | ||
llSetPos(where); | llSetPos(where); | ||
} | } | ||
touch_start(integer num) | |||
{ | |||
llResetScript(); | |||
} | |||
} | |||
</pre> | |||
Corrected Code, Comments welcomed. | |||
--[[User:Mr Lovenkraft|Mr Lovenkraft]] 05:49, 12 November 2007 (PST) | |||
<pre> | |||
//This code was edited by Mr Lovenkraft for errors, comments are below. | |||
vector size; | |||
default | |||
{ | |||
on_rez(integer i) | |||
{ | |||
llSensor("", llGetOwner(), AGENT, 96, PI); //I reversed the "96" and the "PI" because- | |||
} //PI defines the Arc. and 96 Defines the meters. | |||
sensor(integer num) //Not the other way around. | |||
{ | |||
vector where = llDetectedPos(0); | |||
vector agent = llGetAgentSize(llGetOwner())/2; | |||
size += agent + <0,0,.5>; //"size" Has to be defined in some way, I made it a Global | |||
llSetPos(where + size); //In order for "size" to effect this code it must be added in | |||
} //some way, which is why it says "llSetPos(where + size);" | |||
touch_start(integer num) | touch_start(integer num) | ||
{ | { |
Revision as of 06:49, 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 { 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(); } }
Corrected Code, Comments welcomed.
--Mr Lovenkraft 05:49, 12 November 2007 (PST)
//This code was edited by Mr Lovenkraft for errors, comments are below. vector size; default { on_rez(integer i) { llSensor("", llGetOwner(), AGENT, 96, PI); //I reversed the "96" and the "PI" because- } //PI defines the Arc. and 96 Defines the meters. sensor(integer num) //Not the other way around. { vector where = llDetectedPos(0); vector agent = llGetAgentSize(llGetOwner())/2; size += agent + <0,0,.5>; //"size" Has to be defined in some way, I made it a Global llSetPos(where + size); //In order for "size" to effect this code it must be added in } //some way, which is why it says "llSetPos(where + size);" 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 |