Skip to content
Jérôme Leclercq edited this page Dec 8, 2020 · 1 revision

API: match.CreateEntity

Description:

Creates a new entity in the match.

Prototype:

match.CreateEntity(parameters: table) -> entity: Entity

Parameters:

  1. parameters: A table describing all parameters to create the entity.
    Possible fields:
    • (Mandatory) Type: string : The entity class full name (e.g. "entity_box")
    • (Mandatory) LayerIndex: integer : The layer where the entity should be created.
    • (Optional) Position: vec2 : The position to spawn the entity.
    • (Optional) Rotation: number : The rotation the entity should have (in degrees).
    • (Optional) Scale: number : The scale the entity should have.
    • (Optional) Properties: table : A table giving a value for every property of the entity class (some of which may be mandatory).
    • (Optional) Owner: player : A reference to the player owning this entity (which will be credited for damage dealt by this entity).

Returns:

  1. entity: The newly created entity.
Clone this wiki locally