Don't click here unless you want to be banned.

LSL Wiki : llMoveToTarget

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are
llMoveToTarget(vector target, float tau)

Critically damps a physical object's location to position target over tau seconds. Calling llStopMoveToTarget stops the damping. The target is specified in region coordinates. This function returns immediately.

To know when the object actually reaches its target see the at_target and not_at_target events and the llTarget function.

If the target is too far away from the object's current position (~60 meters), or if tau is too small (0.2 is a good tau), this will silently damp it to the object's current position. The interesting thing is the object is in fact damping to its current position when outside the range as opposed to failing completely, but if you move it back to within 60m it will snap back to the target position.

NOTE:I have tried using llMoveToTarget to move my personal av with the object attached to me, and, there at least, it seems it works until 64.999. It will not do 65, but 64.999999999999....etc will work. I used an integer to save it from the message, don't know if that's got anything to do with it.
Argus Stravinsky

Example: The example below will help prevent the 60 meter cap on the function llMoveToTarget.
MoveTarget(vector Pos) //Userfunc
    do //Do-while loop.
        llPushObject((Key of agent/physical object moving),(Pos-llGetPos())*(llVecDist(llGetPos(),Pos)),ZERO_VECTOR,FALSE); //Pushes the avatar to the position.
        llMoveToTarget(Pos,0.05); //If your agent gets close to the avatar it will direct the path.
    while(llVecDist(Pos,llGetPos()) > 40.0); //End of do-while loop.
    llMoveToTarget(Pos,0.05); //Movement
    llSleep(0.25); //Prevents you from flying.
    llStopMoveToTarget(); //Stops the movement

Kageshen Kirax

Note: The force created by calling this function persists until llMoveToTarget is called again with another target in the same script, is called with a tau of 0.0, or llStopMoveToTarget is called. This can be either helpful or hindersome, especially when using a combination of llApplyImpulse and llMoveToTarget.

Warning: If a llMoveToTarget is called from a script while a llMoveToTarget has been previously called from another script and is still running, the second one will silently fail.

This function uses energy at a rate controlled by the tau parameter (even if the object is at the target position). This occurs in parallel with script execution. At around 800+ kilograms mass an object will be too heavy for llMoveToTarget to resist gravity. At that point, gravity will overcome the rate at which energy is replenished and the object will most likely fall to the ground.

Use llSetPos for non-physical objects. llRotLookAt can be used to rotate physical objects.

Example: see at_target

Q: Is there a way of moving an object physically like llMoveToTarget on local axis?
A: try llMoveToTarget(llGetPos() + localaxisoffset * llGetRot(), damp) - Merlin Alphabeta

Q: Does this function work in a child prim of a link set?
A: No. Either put the script in the root prim or use linked messages to relay between the child prim and root prim.

Q: How do I target another avatar or multiple avaters?
A: use llSensor(....) to find the avatar and then use llDetectedPos(0) to find his/her position.

This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | Dynamics Jasa SEO Jasa SEO Murah Sepatu Online Toko Sepatu Online Sepatu Sepatu Murah Sepatu Safety Sepatu Futsal Cheapes Hostgator Coupon Link Booking Televisori offerte Notebook Offerte Berita Terkini Internet Marketer Muda Internet Marketer Indonesia Portatile Apple RDAnet Lorks Karikatur Bisnis Modal Kecil Bisnis UKM Berita Terbaru Iklan Baris Jasa SEO Jasa SEO Murah SEO Indonesia Konsultan SEO SEO Belajar SEO Kursus SEO Kursus SEO Murah Jam Tangan Casio Jam Tangan Casio Jam Tangan Murah Jam Tangan Grosir Baju Terbaru Grosir Baju Baju Terbaru Grosir Baju Murah Bisnis Online Belajar SEO Kerupuk Kerupuk kulit Social Bookmark Dofollow Social Bookmark Kumpulan Puisi Kirim Puisi bola hantu Penumbuh Rambut Penumbuh Rambut timbangan WBC Wonogiri Jasa SEO Murah Jasa SEO Jam Tangan Murah
There are 9 comments on this page. [Display comments/form]