Map

Finding, creating, and destroying map objects.

Function
Returns
Description

FindAllMapObjects()

List(MapObject)

Returns all map objects in the game.

FindMapObjectByName(name: string)

MapObject

Returns the first map object matching the given name

FindMapObjectsByName(name: string)

List(MapObject)

Returns a list of map objects matching the given name

FindMapObjectByID(id: int)

MapObject

Returns the map object matching ID.

FindMapObjectByTag(tag: string)

MapObject

Returns the first map object that has a tag component matching the given name

FindMapObjectsByTag(tag: string)

List(MapObject)

Returns a list of map objects matching the given tag

FindMapObjectsByComponent

List(MapObject)

Returns a list of map objects which have the corresponding CL component attached

CreateMapObjectRaw(data: string)

MapObject

Creates a map object given the raw data string, which corresponds to a map file CSV row

DestroyMapObject(obj: MapObject, includeChildren: bool)

null

Destroys the given map object, and its children if includeChildren is true.

CopyMapObject(obj: MapObject, includeChildren: bool)

MapObject

Creates a copy of the given map object, and its children if includeChildren is true.

DestroyMapTargetable(obj: MapTargetable)

null

Destroys the given map targetable (see MapObject on creating AI targets).

UpdateNavMesh

null

Updates the Navmesh (host only). This operation may take a while depending on the map size. If you have a bad computer, please use UpdateNavMeshAsync to avoid disconnecting due to the non-async method hanging. (honestly I have no idea why you would want to use this but whatever)

UpdateNavMeshAsync

null

Updates the Navmesh (host only) asynchronously and (hopefully) should not hang. This process is still somewhat CPU intensive so maybe pause the game or add in a loading screen when using this. For realtime dynamic changes to the map, please use the NavMeshObstacle Component.

Last updated