Difference between revisions of "LlSetPos"

From Second Life Wiki
Jump to navigation Jump to search
(Qualify 'movement is capped to 10m per call for unattached root prims' with 'unless you exploit the posJump bug')
m
Line 4: Line 4:
|p1_type=vector|p1_name=pos|p1_desc=position in [[Viewer coordinate frames#Region|region]] or [[Viewer coordinate frames#local|local coordinates]] depending on the situation (see ''[[#Specification]]'').|p1_hover=position in region or local coordinates depending on the situation.
|p1_type=vector|p1_name=pos|p1_desc=position in [[Viewer coordinate frames#Region|region]] or [[Viewer coordinate frames#local|local coordinates]] depending on the situation (see ''[[#Specification]]'').|p1_hover=position in region or local coordinates depending on the situation.
|func_desc=Moves the object or primitive towards '''pos''' without using physics.
|func_desc=Moves the object or primitive towards '''pos''' without using physics.
|func_footnote=Movement is capped to 10m per call for unattached root prims, unless you exploit the [[posJump]] bug.
|func_footnote=Movement is capped to 10m per call for unattached root prims.{{Footnote|Unless you exploit the [[posJump]] bug; which will soon be fixed.}}
|spec=
|spec=
=====Coordinate Frame=====
=====Coordinate Frame=====

Revision as of 11:05, 25 December 2008

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.[1]

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

<lsl> //Move the object up 1m when someone touches it. default {

    touch_start(integer i) {
         llSetPos(llGetPos() + <0,0,1>);
    }

}

</lsl>

Notes

Multiple movement commands can be chained together with llSetPrimitiveParams and PRIM_POSITION. The advantage of doing this is that the script only sleeps once per function call instead of once per movement.

See Also

Functions

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

Deep Notes

Search JIRA for related Issues

Footnotes

  1. ^ Unless you exploit the posJump bug; which will soon be fixed.

Signature

function void llSetPos( vector pos );