# Create Units Facing Angle

Grammar — Create count|Number type|Unit for player player at pos facing angle degrees (flags)
FlagsNative | Action

Creates units facing a specified angle. Use the “Last Created Unit” and “Last Created Units” functions to refer to the created units.

# Arguments

  • int — Count
  • string [ gamelink::Unit ] — Type
  • int [ preset::Unit_Create_Style2 ] — Flags
  • int — Player
  • point — Point
  • fixed — Angle

Returns — unitgroup

native unitgroup UnitCreate(
	int inCount,
	string inUnitType,
	int inCreateStyle,
	int inPlayer,
	point inPos,
	fixed inFacing,
);

Category: Unit / Basic

# Examples

# campaigns/liberty.sc2campaign

MapScript.galaxy

// L689
UnitCreate(1, gv_challengeUnits[lv_i].lv_unitType, 0, gv_challengeUnits[lv_i].lv_player, gv_challengeUnits[lv_i].lv_position, gv_challengeUnits[lv_i].lv_facing)
// L166
UnitCreate(1, lp_mEnemyAType, 0, gv_pLAYER_COMPUTER1, RegionGetCenter(lp_mSpawningRegion), libNtve_gf_RandomAngle())
// L178
UnitCreate(1, lp_mEnemyBType, 0, gv_pLAYER_COMPUTER1, RegionGetCenter(lp_mSpawningRegion), libNtve_gf_RandomAngle())
// L190
UnitCreate(1, lp_mEnemyCType, 0, gv_pLAYER_COMPUTER1, RegionGetCenter(lp_mSpawningRegion), libNtve_gf_RandomAngle())
// L1572
UnitCreate(1, "SCV", 0, gv_pLAYER_USER, PointFromId(33), libNtve_gf_RandomAngle())
// L1573
UnitCreate(1, "SCV", 0, gv_pLAYER_USER, PointFromId(34), libNtve_gf_RandomAngle())
// L1574
UnitCreate(1, "SCV", 0, gv_pLAYER_USER, PointFromId(35), libNtve_gf_RandomAngle())
// L1575
UnitCreate(1, "SCV", 0, gv_pLAYER_USER, PointFromId(36), libNtve_gf_RandomAngle())
// L1576
UnitCreate(1, "SCV", 0, gv_pLAYER_USER, PointFromId(37), libNtve_gf_RandomAngle())
// L1577
UnitCreate(1, "SCV", 0, gv_pLAYER_USER, PointFromId(38), libNtve_gf_RandomAngle())
// L1578
UnitCreate(1, "SCV", 0, gv_pLAYER_USER, PointFromId(39), libNtve_gf_RandomAngle())
// L1579
UnitCreate(1, "SCV", 0, gv_pLAYER_USER, PointFromId(40), libNtve_gf_RandomAngle())
// L1580
UnitCreate(1, "SCV", 0, gv_pLAYER_USER, PointFromId(42), libNtve_gf_RandomAngle())
// L1581
UnitCreate(1, "SCV", 0, gv_pLAYER_USER, PointFromId(43), libNtve_gf_RandomAngle())
// L1413
UnitCreate(1, "SupplyDepot", 0, gv_pLAYER_USER, PointFromId(102), 270.0)
// L2208
UnitCreate(1, "SupplyDepot", 0, gv_pLAYER_USER, PointFromId(102), 270.0)
// L2486
UnitCreate(1, "SupplyDepot", 0, gv_pLAYER_USER, PointFromId(102), 270.0)
// L677
UnitCreate(1, gv_challengeUnits[lv_i].lv_unitType, c_unitCreateIgnorePlacement, gv_challengeUnits[lv_i].lv_player, gv_challengeUnits[lv_i].lv_position, gv_challengeUnits[lv_i].lv_facing)
// L660
UnitCreate(1, gv_challengeUnits[lv_i].lv_unitType, 0, gv_challengeUnits[lv_i].lv_player, gv_challengeUnits[lv_i].lv_position, gv_challengeUnits[lv_i].lv_facing)
// L1801
UnitCreate(1, "SS_TerraTronMissileLauncher", c_unitCreateIgnorePlacement, UnitGetOwner(gv_boss), lv_finalOffsetPoint, (lp_facing - 90.0))
// L2638
UnitCreate(1, gf_BackgroundUnitType(lp_iD), 0, gv_p0_NEUTRAL, gv_bGStart, 180.0)
// L2702
UnitCreate(1, "SS_BlackEdgeBorder", 0, gv_p0_NEUTRAL, PointWithOffset(lv_center, -36.0, 0.0), 180.0)
// L2706
UnitCreate(1, "SS_BlackEdgeBorder", 0, gv_p0_NEUTRAL, PointWithOffset(lv_center, 35.4, 0.0), 180.0)
// L2744
UnitCreate(lp_count, lp_type, 0, gv_p2_ENEMY, lp_pos, lp_angle)
// L2895
UnitCreate(1, lp_type, 0, gv_p0_NEUTRAL, lp_pos, libNtve_gf_RandomAngle())
// L5823
UnitCreate(1, "SS_TerraTronMissileSpinnerLauncher", c_unitCreateIgnorePlacement, UnitGetOwner(gv_boss), UnitGetPosition(gv_missileSpinnerL), lv_facingL)
// L5829
UnitCreate(1, "SS_TerraTronMissileSpinnerLauncher", c_unitCreateIgnorePlacement, UnitGetOwner(gv_boss), UnitGetPosition(gv_missileSpinnerR), lv_facingR)
// L5851
UnitCreate(1, "SS_TerraTronMissileSpinnerLauncher", c_unitCreateIgnorePlacement, UnitGetOwner(gv_boss), UnitGetPosition(gv_missileSpinnerL), lv_facingL)
// L5857
UnitCreate(1, "SS_TerraTronMissileSpinnerLauncher", c_unitCreateIgnorePlacement, UnitGetOwner(gv_boss), UnitGetPosition(gv_missileSpinnerR), lv_facingR)
// L306
UnitCreate(1, "ColonistTransport", 0, gv_p4_COLONISTS, PointFromId(2906), 180.0)
// L457
UnitCreate(lp_number, lp_unitType, 0, gv_pLAYER_04_INFESTEDREFUGEES, RegionRandomPoint(lp_spawnRegion), libNtve_gf_RandomAngle())
// L4923
UnitCreate(1, "InfestedCivilian", 0, gv_pLAYER_04_INFESTEDREFUGEES, RegionRandomPoint(RegionFromId(44)), libNtve_gf_RandomAngle())
// L4941
UnitCreate(1, "InfestedCivilian", 0, gv_pLAYER_04_INFESTEDREFUGEES, RegionRandomPoint(RegionFromId(45)), libNtve_gf_RandomAngle())
// L6009
UnitCreate(2, "Colonist", 0, gv_pLAYER03_COLONIST, RegionRandomPoint(RegionFromId(4)), libNtve_gf_RandomAngle())
// L6010
UnitCreate(2, "Colonist", 0, gv_pLAYER03_COLONIST, RegionRandomPoint(RegionFromId(4)), libNtve_gf_RandomAngle())
// L6011
UnitCreate(1, "ColonistFemale", 0, gv_pLAYER03_COLONIST, RegionRandomPoint(RegionFromId(4)), libNtve_gf_RandomAngle())
// L6012
UnitCreate(2, "Colonist", 0, gv_pLAYER03_COLONIST, RegionRandomPoint(RegionFromId(5)), libNtve_gf_RandomAngle())
// L6013
UnitCreate(1, "ColonistFemale", 0, gv_pLAYER03_COLONIST, RegionRandomPoint(RegionFromId(5)), libNtve_gf_RandomAngle())
// L6014
UnitCreate(2, "Colonist", 0, gv_pLAYER03_COLONIST, RegionRandomPoint(RegionFromId(6)), libNtve_gf_RandomAngle())
// L6015
UnitCreate(1, "ColonistFemale", 0, gv_pLAYER03_COLONIST, RegionRandomPoint(RegionFromId(6)), libNtve_gf_RandomAngle())
// L6016
UnitCreate(3, "Colonist", 0, gv_pLAYER03_COLONIST, RegionRandomPoint(RegionFromId(26)), libNtve_gf_RandomAngle())
// L6017
UnitCreate(1, "ColonistFemale", 0, gv_pLAYER03_COLONIST, RegionRandomPoint(RegionFromId(26)), libNtve_gf_RandomAngle())
// L6018
UnitCreate(2, "Colonist", 0, gv_pLAYER03_COLONIST, RegionRandomPoint(RegionFromId(27)), libNtve_gf_RandomAngle())
// L335
UnitCreate(1, lp_type, 0, gv_p03_VIROPHAGE, RegionRandomPoint(RegionCircle(UnitGetPosition(gv_infestationVirophageUnit[lp_colonyIndex]), 5.0)), libNtve_gf_RandomAngle())
// L593
UnitCreate(1, lv_defenderType, 0, gv_p07_ZERG_INFESTED, gv_infestationDefenderLocation[lp_colonyIndex][lp_defenderIndex], libNtve_gf_RandomAngle())
// L599
UnitCreate(1, lv_defenderType, 0, gv_p07_ZERG_INFESTED, gv_infestationDefenderLocation[lp_colonyIndex][lp_defenderIndex], libNtve_gf_RandomAngle())
// L2185
UnitCreate(1, "Feederling", 0, gv_p07_ZERG_INFESTED, UnitGetPosition(lv_virophage), 270.0)
// L4529
UnitCreate(1, "Feederling", 0, gv_p07_ZERG_INFESTED, RegionRandomPoint(RegionFromId(9)), 270.0)
// L2300
UnitCreate(1, "PalletMinerals", 0, 0, RegionRandomPoint(RegionCircle(UnitGetPosition(gv_trainList[lv_trainIndex].lv_trainCars[RandomInt(1, gv_trainList[lv_trainIndex].lv_lastCar)]), 2.0)), RandomFixed(0.0, 360.0))
// L2305
UnitCreate(1, "PalletGas", 0, 0, RegionRandomPoint(RegionCircle(UnitGetPosition(gv_trainList[lv_trainIndex].lv_trainCars[RandomInt(1, gv_trainList[lv_trainIndex].lv_lastCar)]), 2.0)), RandomFixed(0.0, 360.0))
// L2312
UnitCreate(1, "AdjutantCapsule", 0, 0, RegionRandomPoint(RegionCircle(UnitGetPosition(gv_trainList[lv_trainIndex].lv_trainCars[lv_trainMidPoint]), 2.0)), (UnitGetFacing(gv_trainList[lv_trainIndex].lv_trainCars[lv_trainMidPoint]) - 90.0))
// L4543
UnitCreate(1, "DominionKillTeam", 0, gv_pLAYER_02_DOMINION, PointFromId(532), 90.0)
// L4554
UnitCreate(1, "Medic", 0, gv_pLAYER_02_DOMINION, PointFromId(532), 90.0)
// L4628
UnitCreate(1, "DominionKillTeam", 0, gv_pLAYER_02_DOMINION, PointFromId(1797), 45.0)
// L4639
UnitCreate(1, "Medic", 0, gv_pLAYER_02_DOMINION, PointFromId(1797), 45.0)
// L4711
UnitCreate(1, "DominionKillTeam", 0, gv_pLAYER_02_DOMINION, PointFromId(532), 45.0)
// L1562
UnitCreate(1, "StarportFlying", 0, gv_p01_USER, PointFromId(75), 315.0)
// L2891
UnitCreate(1, "TychusEjectMissile", 0, gv_p07_HORNERBASE, UnitGetPosition(gv_odin), UnitGetFacing(gv_odin))
// L3746
UnitCreate(1, "Raven", 0, gv_p08_DOMINION, PointFromId(1076), 270.0)
// L3749
UnitCreate(1, "Raven", 0, gv_p08_DOMINION, PointFromId(1369), 270.0)
// L3848
UnitCreate(1, "Raven", 0, gv_p08_DOMINION, libNtve_gf_RandomPointBetweenPoints(PointFromId(876), PointFromId(964)), 270.0)
// L3994
UnitCreate(1, "Raven", 0, gv_p08_DOMINION, libNtve_gf_RandomPointBetweenPoints(PointFromId(572), PointFromId(591)), 270.0)
// L4669
UnitCreate(1, "TransportTruck", 0, gv_p2_DOMINION_RED, PointFromId(2676), 45.0)
// L4671
UnitCreate(1, "TransportTruck", 0, gv_p2_DOMINION_RED, PointFromId(2678), 45.0)
// L4830
UnitCreate(1, "Raven", 0, gv_p2_DOMINION_RED, PointFromId(2439), 225.0)
// L5057
UnitCreate(1, "Marine", 0, gv_pLAYER_01_USER, lv_marinePoints1[1], 225.0)
// L384
UnitCreate(lp_qty, lp_unitType, 0, lp_player, UnitGetPosition(lp_nydus), libNtve_gf_RandomAngle())
// L397
UnitCreate(lp_qty, lp_unitType, 0, lp_player, UnitGetPosition(lp_nydus), libNtve_gf_RandomAngle())
// L458
UnitCreate(lp_qty, lp_unitType, 0, lp_player, UnitGetPosition(lp_nydus), libNtve_gf_RandomAngle())
// L12563
UnitCreate(1, UnitGetType(lv_indexUnit), 0, 0, lv_loc, lp_facing)
// L12787
UnitCreate(1, UnitGetType(lv_indexUnit), 0, 0, lv_loc, lp_facing)
// L36625
UnitCreate(1, "SMKerriganPhoto", 0, 0, UnitGetPosition(gf_ActorUnit(ge_ActorID_ActorRaynor)), UnitGetFacing(gf_ActorUnit(ge_ActorID_ActorRaynor)))
// L37255
UnitCreate(1, "SMHyperionArmoryStage1Set02", 0, 0, UnitGetPosition(gf_RoomUnit(ge_RoomID_RoomArmory)), UnitGetFacing(gf_RoomUnit(ge_RoomID_RoomArmory)))
// L5111
UnitCreate(1, "SpecialOpsDropship", 0, gv_p01_USER, PointFromId(792), 45.0)
// L5113
UnitCreate(1, "SCV", 0, gv_p01_USER, PointFromId(291), libNtve_gf_RandomAngle())
// L5115
UnitCreate(1, "SCV", 0, gv_p01_USER, PointFromId(787), libNtve_gf_RandomAngle())
// L5117
UnitCreate(1, "SCV", 0, gv_p01_USER, PointFromId(788), libNtve_gf_RandomAngle())
// L5119
UnitCreate(1, "SCV", 0, gv_p01_USER, PointFromId(789), libNtve_gf_RandomAngle())
// L5121
UnitCreate(1, "SCV", 0, gv_p01_USER, PointFromId(790), libNtve_gf_RandomAngle())
// L5124
UnitCreate(1, "Marine", 0, gv_p01_USER, RegionRandomPoint(RegionFromId(64)), libNtve_gf_RandomAngle())
// L5129
UnitCreate(1, "Medic", 0, gv_p01_USER, RegionRandomPoint(RegionFromId(66)), libNtve_gf_RandomAngle())
// L2213
UnitCreate(1, "TerrazineCanister", 0, gv_p5_TERRAZINE, UnitGetPosition(EventUnit()), 0.0)
// L2797
UnitCreate(1, "Diamondback", 0, gv_p0_NEUTRAL, RegionGetCenter(RegionFromId(18)), 43.0)
// L2807
UnitCreate(1, "SiegeTank", 0, gv_p0_NEUTRAL, RegionGetCenter(RegionFromId(20)), 135.0)
// L2814
UnitCreate(1, "SiegeTank", 0, gv_p0_NEUTRAL, RegionGetCenter(RegionFromId(19)), 45.0)
// L785
UnitCreate(1, "MineralField", 0, 0, RegionGetCenter(lp_mineralFieldArea), 270.0)
// L4724
UnitCreate(1, "CreepTumorBurrowed", 0, gv_p2_ZERG, PointFromId(355), 270.0)
// L4725
UnitCreate(1, "CreepTumorBurrowed", 0, gv_p2_ZERG, PointFromId(412), 270.0)
// L4726
UnitCreate(1, "CreepTumorBurrowed", 0, gv_p2_ZERG, PointFromId(1918), 270.0)
// L4727
UnitCreate(1, "CreepTumorBurrowed", 0, gv_p2_ZERG, PointFromId(1919), 270.0)
// L4884
UnitCreate(12, "Zergling", 0, gv_p2_ZERG, RegionGetCenter(RegionFromId(49)), 270.0)
// L4338
UnitCreate(1, "XelNagaTemple", 0, gv_p8_ANCIENT_TEMPLE, lv_location, lv_facing)
// L4350
UnitCreate(1, "DrakkenLaserDrill", c_unitCreateIgnorePlacement, lv_player, lv_location, lv_facing)
// L4434
UnitCreate(1, "DrakkenLaserDrill", c_unitCreateIgnorePlacement, lv_player, lv_location, lv_facing)
// L4654
UnitCreate(1, "RipFieldGenerator", c_unitCreateIgnorePlacement, gv_pLAYER_05_WORLDSHIP, PointFromId(169), 270.0)
// L557
UnitCreate(1, lp_gankUnitType, 0, gv_p07_ZERG_PINK, RegionRandomPoint(gf_GetClosestRegionToSpawn(lp_spawnRegion)), libNtve_gf_RandomAngle())
// L565
UnitCreate(1, lp_gankUnitType, 0, gv_p07_ZERG_PINK, RegionRandomPoint(lp_spawnRegion), libNtve_gf_RandomAngle())
// L695
UnitCreate(1, lp_buildingType, 0, gv_p08_RESCUABLE, gv_bDPLandingPoint, 225.0)
// L1744
UnitCreate(1, "SpineCrawlerUprooted", 0, gv_p07_ZERG_PINK, PointFromId(36), libNtve_gf_RandomAngle())
// L1748
UnitCreate(1, "SpineCrawlerUprooted", 0, gv_p07_ZERG_PINK, PointFromId(29), libNtve_gf_RandomAngle())