Difference between revisions of "LlSetPos"

From Second Life Wiki
Jump to navigation Jump to search
(Added Example)
Line 18: Line 18:
*This function does not work for physical objects. Use [[llMoveToTarget]] instead.
*This function does not work for physical objects. Use [[llMoveToTarget]] instead.
|constants
|constants
|examples
|examples=
<pre>
//Move the object up 1m when someone touches it.
default {
    touch_start(integer i) {
          llSetPos(llGetPos() + <0,0,1>);
    }
}
</pre>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llGetLocalPos]]|Returns the prim's local position if it is attached or non-root (otherwise it returns the global position)}}
|also_functions={{LSL DefineRow||[[llGetLocalPos]]|Returns the prim's local position if it is attached or non-root (otherwise it returns the global position)}}

Revision as of 15:24, 12 October 2007

Summary

Function: llSetPos( vector pos );

Moves the object or primitive towards pos without using physics.

• vector pos position in region or local coordinates depending on the situation (see #Specification).

Movement is capped to 10m per call for unattached root prims.

Specification

Coordinate Frame

Caveats

  • This function causes the script to sleep for 0.2 seconds.
  • Because of the intermixing of local and regional coordinates with this function, when a prims position is wanted it is best to use llGetLocalPos.
  • This function does not work for physical objects. Use llMoveToTarget instead.
All Issues ~ Search JIRA for related Bugs

Examples

//Move the object up 1m when someone touches it.
default {
     touch_start(integer i) {
          llSetPos(llGetPos() + <0,0,1>);
     }
}

See Also

Functions

•  llGetLocalPos Returns the prim's local position if it is attached or non-root (otherwise it returns the global position)
•  llGetPos Returns the prim's global position, even if it is attached or non-root

Deep Notes

Search JIRA for related Issues

Signature

function void llSetPos( vector pos );