Skip to content

PRIM_POSITION

constant
Constant
integer PRIM_POSITION = 6;
Set with llSetLinkPrimitiveParamsFast
PRIM_POSITION, vector position
Get with llGetLinkPrimitiveParams, llGetPrimitiveParams
PRIM_POSITION → vector position

Prim parameter [PRIM_POSITION, vector position] to get or set the position of the prim in region coordinates (or local coordinates depending on the script context).

Other PrimParam values (42)
Other PrimParamGet values (40)

PRIM_POSITION is used to get or set the prim’s position.

llSetLinkPrimitiveParamsFast(LINK_THIS, [ ..., PRIM_POSITION, vector position, ... ]);

The same syntax applies to llSetLinkPrimitiveParams and llSetLinkPrimitiveParamsFast but with an additional prefixed link parameter in the function call.

  • Depending upon the situation positionset may need to be in local coordinates or region coordinates, See llSetPos for details.
    • It is usually not a good idea to combine PRIM_POSITION with LINK_SET. The root will treat the coordinates as world or attachment, while the children will treat them as local, yielding inconsistent results or failure. If you want to move the object as a unit, use LINK_ROOT instead.
  • The range the prim can move is limited if it is an unattached root prim. The distance is capped to 10m per PRIM_POSITION call. See WarpPos. This is a very special case. Do not rely on rule duplication of other flags - the results are undefined, and things will break in the future.
  • Moving avatars with PRIM_POSITION
    • Moving the prim the avatar sat upon does not move the avatar.
    • Moving an avatar does not move the prim they sat upon.
    • Sit-target coordinates do not easily map to prim coordinates, use UpdateSitTarget.
    • If you have explicitally set your object as “static obstacle” for pathfinding , the function will fail with the error in the debug channel : “Unable to set prim position or scale: object contributes to the navmesh.”
    • If positionset is greater than 54 meters away from the center, the repositioning will silently fail.
  • A world object cannot be moved below the region ground level, and the midpoint of the root will be snapped to the ground instead.

Avatars sitting on the object can be moved with llSetLinkPrimitiveParams and PRIM_POSITION. This was originally a mis-feature but according to Andrew Linden LL has decided to support it.

The below example moves an avatar to x,y,z without moving the prim they are sitting on. If x,y,z is more than 54 meters away the call will silently fail. Remember x,y,z is in object relative coordinates just like any other linked prim in a set.

Avatars are always the last prims in the set, so llGetNumberOfPrims can be used for a single avatar sitting on a vehicle.

Example:

llSetLinkPrimitiveParamsFast(llGetNumberOfPrims(), [PRIM_POSITION, <x,y,z>]);
llGetLinkPrimitiveParams(LINK_THIS, [ ..., PRIM_POSITION, ... ]);

Returns the same values, in the same order.

The same syntax applies to llGetLinkPrimitiveParams, but with an additional prefixed link parameter in the function call.

Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.