# Method WorldObject:GetNearObject [-] [+]

Returns nearest WorldObject in sight of the WorldObject. The distance, type, entry and hostility requirements the WorldObject must match can be passed.

## Synopsis

`worldObject = WorldObject:GetNearObject( range )`

`worldObject = WorldObject:GetNearObject( range, type )`

`worldObject = WorldObject:GetNearObject( range, type, entry )`

`worldObject = WorldObject:GetNearObject( range, type, entry, hostile )`

`worldObject = WorldObject:GetNearObject( range, type, entry, hostile, dead )`

## Arguments

`number range (533)`

  Valid numbers: all decimal numbers.

`TypeMask type (0)`

  The [TypeMask] that the WorldObject must be. This can contain multiple types. 0 will be ingored.

`number entry (0)`

  The entry of the WorldObject, 0 will be ingored.

  Valid numbers: integers from 0 to 4,294,967,295.

`number hostile (0)`

  Specifies whether the WorldObject needs to be 1 hostile, 2 friendly or 0 either.

  Valid numbers: integers from 0 to 4,294,967,295.

`number dead (1)`

  0 both, 1 alive, 2 dead.

  Valid numbers: integers from 0 to 4,294,967,295.

## Returns

`WorldObject worldObject`
  See method description.

# Keyboard shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result

# Search tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct` (or `str`), `enum`, `trait`, `typedef` (or `tdef`).

Generated on
© 2010 - 2024 Eluna Lua Engine