Difference between revisions of "LlMoveToTarget"
Jump to navigation
Jump to search
Line 2: | Line 2: | ||
|func_id=70|func_sleep=0.0|func_energy=10.0 | |func_id=70|func_sleep=0.0|func_energy=10.0 | ||
|func=llMoveToTarget | |func=llMoveToTarget | ||
|p1_type=vector|p1_name=target|p1_desc= | |p1_type=vector|p1_name=target|p1_desc=[[Viewer coordinate frames#Region|region]] position | ||
|p2_type=float|p2_name=tau | |p2_type=float|p2_name=tau | ||
|func_footnote=To stop the object from maintaining the '''target''' positions use {{LSLG|llStopMoveToTarget}}<br/> | |func_footnote=To stop the object from maintaining the '''target''' positions use {{LSLG|llStopMoveToTarget}}<br/> |
Revision as of 14:48, 4 March 2007
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: llMoveToTarget( vector target, float tau );70 | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
Critically damp to target in tau seconds (if the script is physical)
• vector | target | – | region position | |
• float | tau | – | seconds to critically damp in |
To stop the object from maintaining the target positions use llStopMoveToTarget
To change the rotation in the same manner use llLookAt or llRotLookAt.
Caveats
Examples
Will Move your object to a position
// script created by SpiritWolf Chikuwa // // /!\ PUBLIC DOMAIN /!\ // You can Copy/Mod/Trans // Please, do not resell this script and give it full perm // Just please leave this header intact // // Minor changes: (insert your name here and delete this comment if you do any mod of this script, thank you) // // Script start here: default { state_entry() //i use for this example a "state_entry", so the item move the first second you //rez it, but if needed you can change it with something else like "touch_start", //it's will move only if you click on it, the alternative of "stat_entry" is //"on_rez", the item will move only if rezzed, and now directly when the script // will be compiled { llSetStatus(STATUS_PHYSICS | STATUS_PHANTOM, TRUE); // of course llSetStatus must be used // with physic (we move the item, and phantom, it's not needed, but better if the object must // don't collide with something on his way. Also, it's physic, so be carefull, only 31 prims // for an item allowed. llMoveToTarget(<53.654,199.364,502.542>, 10); // this is waht we want the llMoveToTarget, // will move the item to the axes X,Y,Z localy on the curent sim where is the prim, in the 10 // on this exampel is the speed, actually, the item will move slowly } }