# llEdgeOfWorld

*LSL function*

```lsl
integer integer llEdgeOfWorld(vector pos, vector dir);
```

- `vector pos`: Position vector in region coordinates.
- `vector dir`: Direction vector.

- Returns: `integer`
- Energy: 10

Checks to see whether the border hit by **dir** from **pos** is the edge of the world (has no neighboring simulator).

The **z** component of **dir** is ignored.

Returns an [integer](https://wiki.secondlife.com/wiki/integer) value. [FALSE](/constants/FALSE/) indicating there is a simulator in the direction indicated.

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

## Caveats

- If the **x** and **y** components of **dir** are zero (like with [ZERO_VECTOR](/constants/ZERO_VECTOR/)), [TRUE](/constants/TRUE/) is always returned.
- **pos** must be in the region.
- Can only be used to detect directly adjacent regions, not diagonally adjacent regions
- This function will also return [TRUE](/constants/TRUE/) if [llRequestSimulatorData](/functions/llRequestSimulatorData/)() returns "up" for an adjacent region but that region doesn't visibly show when standing next to its border.

## Examples

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

```lsl
//--// Tells if there are neighboring sims on touch //--//

default{
  touch_start( integer vIntTouched ){
    vector vPosObject = llGetPos();
    if (!llEdgeOfWorld( vPosObject, <0.0, 1.0, 0.0> )){
      llOwnerSay( "There is a Sim to the North" );
    }
    if (!llEdgeOfWorld( vPosObject, <1.0, 0.0, 0.0> )){
      llOwnerSay( "There is a Sim to the East" );
    }
    if (!llEdgeOfWorld( vPosObject, <0.0, -1.0, 0.0> )){
      llOwnerSay( "There is a Sim to the South" );
    }
    if (!llEdgeOfWorld( vPosObject, <-1.0, 0.0, 0.0> )){
      llOwnerSay( "There is a Sim to the West" );
    }
  }
}
```

</details>

## See also

### Functions

- [llScriptDanger](/functions/llScriptDanger/)

---

*Source: [LlEdgeOfWorld](https://wiki.secondlife.com/wiki/LlEdgeOfWorld) on the Second Life Wiki. Content from the Second Life Wiki articles LlEdgeOfWorld (revision 1218564, 2025-12-23) and Template:LSL Function/position (revision 1169387, 2012-06-18), CC BY-SA 3.0.*

---

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