• Creates a unit of type unitid for player id, facing a certain direction at the provided coordinates. Returns handle to unit.

    Example: Create a human footman for first player (red) at map coordinates -30, 0, facing north:

        // Jass
    call CreateUnit(Player(0), 'hfoo', -30, 0, 90)
        -- Lua
    CreateUnit(Player(0), FourCC("hfoo"), -30, 0, 90)

    Parameters

    • id: Player<PlayerEventMap>

      The owner of the unit.

    • unitid: number

      The rawcode of the unit.

    • x: number

      The x-coordinate of the unit.

    • y: number

      The y-coordinate of the unit.

    • face: number

      Unit facing in degrees.

      • 0 = East
      • 90 = North
      • 180 = West
      • 270 = South
      • -90 = South (wraps around)

    Returns Unit

    Note

    See: bj_UNIT_FACING constant for default facing direction of units in BJ scripts and GUI.

Generated using TypeDoc