LSL Wiki Mirror 10-5-2006: llMoveToTarget

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings ::
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


Note: The force created by calling this function persists until llMoveToTarget is called again with another target, 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.

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


Functions | Dynamics
There are 5 comments on this page. [Display comments/form]