Difference between revisions of "LlSetScale"
Jump to navigation
Jump to search
All Issues ~ Search JIRA for related Bugs
(Added Example) |
|||
Line 6: | Line 6: | ||
|func_footnote='''x''', '''y''' & '''z''' components of '''scale''' need to be in the range [0.01, 10.0], if they are out of the range they are rounded to the nearest endpoint. | |func_footnote='''x''', '''y''' & '''z''' components of '''scale''' need to be in the range [0.01, 10.0], if they are out of the range they are rounded to the nearest endpoint. | ||
|spec | |spec | ||
|caveats | |caveats=This function only changes the scale of the ''prim'' that the script is in. '''Not''' the entire object. | ||
|constants | |constants | ||
|examples | |examples= | ||
<pre> | |||
//A basic door that opens and closes when an avatar colides with it. | |||
//Not very effective, as it would be better to use llSetStatus(STATUS_PHANTOM, 1)... | |||
//But, it works. | |||
vector startingSize; | |||
default { | |||
state_entry() { | |||
startingSize = llGetScale(); | |||
} | |||
collision_start(integer i) { | |||
llSetScale(<.1, .1, .1>); | |||
llSetTimerEvent(3); | |||
} | |||
timer() { | |||
llSetTimerEvent(0); | |||
llSetScale(startingSize); | |||
} | |||
} | |||
</pre> | |||
|helpers | |helpers | ||
|also_functions={{LSL DefineRow||[[llGetScale]]|Gets the prims size}} | |also_functions={{LSL DefineRow||[[llGetScale]]|Gets the prims size}} |
Revision as of 12:22, 28 November 2007
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: llSetScale( vector scale );47 | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
Sets the scale of the prim according to scale
• vector | scale |
x, y & z components of scale need to be in the range [0.01, 10.0], if they are out of the range they are rounded to the nearest endpoint.
Caveats
This function only changes the scale of the prim that the script is in. Not the entire object.
Examples
//A basic door that opens and closes when an avatar colides with it. //Not very effective, as it would be better to use llSetStatus(STATUS_PHANTOM, 1)... //But, it works. vector startingSize; default { state_entry() { startingSize = llGetScale(); } collision_start(integer i) { llSetScale(<.1, .1, .1>); llSetTimerEvent(3); } timer() { llSetTimerEvent(0); llSetScale(startingSize); } }
See Also
Functions
• | llGetScale | – | Gets the prims size | |
• | llSetPrimitiveParams | – | Sets prims attributes | |
• | llGetPrimitiveParams | – | Gets prims attributes |