FANDOM


The CreateUnit native creates a unit. It is defined as follows:

native CreateUnit takes player id, integer unitid, real x, real y, real face returns unit

The parameters are as follows:

player 'id' (The player for whom the unit is to be created)

integer 'unitid' (the unit type id of the unit to be created)

real 'x' (the x coordinate at which the unit should be placed)

real 'y' (the y coordinate at which the unit should be placed)

real 'face' (the angle, in degrees, that the unit should initially face)

Example call:

local unit u = CreateUnit( Player(0), 'hfoo', GetRectCenterX(someRect), GetRectCenterY(someRect), bj_UNIT_FACING )

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.