# llSetRegionPos

*LSL function*

```lsl
integer integer llSetRegionPos(vector position);
```

- `vector position`: Target position vector in region coordinates (can cross up to 10m over a region border).

- Returns: `integer`
- Energy: 10

Tries to move the entire object so that the root prim is within 0.1m of **position**.

Only if [TRUE](/constants/TRUE/) is returned does the object move, if [FALSE](/constants/FALSE/) is returned, the object does not change position. (Spec does not quite agree, if object tries to go underground, the spec says it moves to ground level with the provided X and Y.)

Returns an [integer](https://wiki.secondlife.com/wiki/integer) , [TRUE](/constants/TRUE/) if the object is successfully placed within 0.1 m of **position**, [FALSE](/constants/FALSE/) otherwise. See [specification](#specification) for details.

```lsl title="How to use" frame="terminal"
integer result = llSetRegionPos(ZERO_VECTOR);
```

## Specification

The object with the script will move the root prim position to the given location. The position is any position within the region. If the position is below ground, it will be set to the ground level at that X,Y spot. The function has no delay or throttle.

- Returns [TRUE](/constants/TRUE/) if the object is successfully placed within 0.1 m of position.
- Returns [FALSE](/constants/FALSE/) and does not move the object if...
- **position** is more than 10m off region or above 4096m.
- The x & y components of **position** must be in the range \[-10.0, 266.0\].
- The z component must be in the range \[0.0, 4096\].
- the object is dynamic (has [physics enabled](/constants/STATUS_PHYSICS/)).
- the object can not move to position due to parcel/region restrictions (object entry rules, prim limits, bans, etc).
- the object is an avatar attachment.
- Returns [FALSE](/constants/FALSE/) if the position is a point more than 0.1 m below region ground level, but the object will still be moved so that the midpoint of the root prim is snapped to the ground. If the point is less than 0.1 m below ground, the object is moved as before and [TRUE](/constants/TRUE/) is returned as per the first case.

## Examples

<details open>
<summary>Example 1</summary>

```lsl collapse={1-6, 12-26}
default
{
    touch_start(integer num_detected)
    {
        vector currentPosition = llGetPos();

        // check whether the object has successfully been moved
        // to the center of the sim at the same height
        integer hasMoved = llSetRegionPos(<128.0, 128.0, currentPosition.z>);

        if (hasMoved)
        {
            llOwnerSay("My new position is now:\n"
                + "http://maps.secondlife.com/secondlife/" + llEscapeURL(llGetRegionName())
                + "/128/128/" + (string)llRound(currentPosition.z) + "/");
        }
        else if ( currentPosition.z < llGround(ZERO_VECTOR) )
        {
            llOwnerSay("My new position is now:\n"
                + "http://maps.secondlife.com/secondlife/" + llEscapeURL(llGetRegionName())
                + "/128/128/" + (string)llCeil(llGround(ZERO_VECTOR)) + "/");
        }
        else
            llOwnerSay("Move was not possible!");
    }
}
```

</details>

## Notes

This function is intended to replace [WarpPos](https://wiki.secondlife.com/wiki/WarpPos).

## History

- New LSL function integer `llSetRegionPos(vector position)` in Second Life Server 12.01.24.248357
- : The object with the script will move the root prim position to the given location. The position is any position within the region. If the position is below ground, it will be set to the ground level at that X,Y spot. The function has no delay or throttle.
- :\* Returns 1 if the object is successfully placed within 0.1 m of position.
- :\* Returns 0 and does not move the object if position is more than 10m off region or above 4096m.
- :\* Returns 0 and does not move the object if the object is dynamic (has physics enabled).
- :\* Returns 0 and does not move the object if the object can not move to position due to object entry rules, prim limits, bans, etc.

## See also

### Functions

- [llGetLocalPos](/functions/llGetLocalPos/) — Returns the prim's local position if it is attached or non-root (otherwise it returns the global position)
- [llGetRootPosition](/functions/llGetRootPosition/) — Gets the root prims position
- [llGetPos](/functions/llGetPos/) — Returns the prim's global position, even if it is attached or non-root
- [llSetPos](/functions/llSetPos/)
- [llEdgeOfWorld](/functions/llEdgeOfWorld/)

---

*Source: [LlSetRegionPos](https://wiki.secondlife.com/wiki/LlSetRegionPos) on the Second Life Wiki. Content from the Second Life Wiki articles LlSetRegionPos (revision 1218848, 2026-05-19) and Template:LSL Function/position (revision 1169387, 2012-06-18), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llSetRegionPos/
