MapObject

Inherits from Object. MapObject represents a map object created in the editor.

Fields

Field
Type
Readonly
Description

Name

string

true

Name of the map object.

Position

Vector3

false

Position of the map object.

LocalPosition

Vector3

false

Local position of the map object. This is the same as Position if there is no parent.

Rotation

Vector3

false

Rotation of the map object.

LocalRotation

Vector3

false

Local rotation of the map object. This is the same as Rotation if there is no parent.

QuaternionRotation

Quaternion

false

Quaternion rotation of the map object.

QuaternionLocalRotation

Quaternion

false

Quaternion local rotation of the map object.

Forward

Vector3

false

Forward vector of the map object.

Up

Vector3

false

Up vector of the map object.

Right

Vector3

false

Right vector of the map object.

Scale

Vector3

false

Scale of the map object.

Parent

MapObject

false

Parent of the map object. Returns null if there is no parent.

Active

bool

false

Whether or not the map object is active.

Static

bool

true

Whether or not the map object is static.

Transform

Transform

true

Gets the transform component of the map object.

Color

Color

false

The main color of the map object.

ID

int

true

The ID of the map object.

HasRenderer

bool

true

Whether the MapObject has a renderer attached.

TextureTilingX

float

false

Sets the texture tiling x of the first renderer. Throws an exception if it does not exist or is static.

TextureTilingY

float

false

Sets the texture tiling y of the first renderer. Throws an exception if it does not exist or is static.

TextureOffsetX

float

false

Sets the texture offset x of the first renderer. Throws an exception if it does not exist or is static.

TextureOffsetY

float

false

Sets the texture offset y of the first renderer. Throws an exception if it does not exist or is static.

Functions

Function
Returns
Description

GetComponent(name: string)

Component

Gets the component with given name.

AddComponent(name: string)

Component

Adds the component to the object, calls Init, and returns the component.

RemoveComponent(name: string)

null

Removes the component if found on the object.

SetComponentEnabled(name: string, enabled: bool)

null

Sets the attached component to enabled or not.

SetComponentsEnabled(enabled: bool)

null

Sets all attached components to enabled or not.

GetChild(name: string)

MapObject

Gets the child with given name.

GetChildren()

List

Gets a list of direct children of the map object.

GetTransform(name: string)

Transform

Gets the child transform with given name.

AddSphereCollider(collideMode: string, collideWith: string, center: Vector3, radius: float)

null

Adds a sphere collider with given mode, collide, center, and radius. Valid collide modes are "Physical", "Region", "None". Valid collide with are "All", "MapObjects", "Characters", "Projectiles", "Titans", "Humans", "Entities", "Hitboxes".

AddBoxCollider(collideMode: string, collideWith: string, center: Vector3, size: Vector3)

null

Adds a box collider with given mode, collide, center, and size. Removing center and size fields will attempt to auto-size the collider to the bounds of the object.

AddSphereTarget(team: string, center: Vector3, radius: float)

MapTargetable

Adds a sphere collider as a region with the layer of "HitBoxes" and sets it as a targetable object. See MapTargetable for more details.

AddBoxTarget(team: string, center: Vector3, size: Vector3)

MapTargetable

Adds a boxcollider as a region with the layer of "HitBoxes" and sets it as a targetable object.

SetColorAll(color: Color)

null

Sets all colors on the MapObject.

InBounds(position: Vector3)

bool

Returns true if the position is inside the bounds of the MapObject's colliders.

GetBoundsAverageCenter

Vector3

Gets the center of all of the bounds of all hitboxes on the object. Returns Vector3.Zero if there are no colliders.

GetBoundsCenter

Vector3

Gets the center of the first (main) hitbox on the object. Use this for objects with a single model/collider (geometry). Returns null if there are no colliders.

GetBoundsSize

Vector3

Gets the size of the bounds. Returns null if there are no colliders.

GetBoundsMin

Vector3

Gets the lower corner of the Bounds. Returns null if there are no colliders.

GetBoundsMax

Vector3

Gets the upper corner of the Bounds. Returns null if there are no colliders.

GetCorners

List(Vector3)

Gets all eight corners of the bounds. Returns null if there are no colliders.

Last updated