# Unload Unit Model
Grammar — Unload model for u
Flags —Native
|Action
Unloads a unit model.
# Arguments
unit
— Unit
Returns — void
native void UnitUnloadModel(unit inUnit);
# Related
Category: Unit / Basic
- Unit Show Kill Display —
void
— UnitShowKillDisplay - Unit Can Path To Point —
bool
— UnitPathableToPoint - Unit Can Path To Unit —
bool
— UnitPathableToUnit - Create Units With Default Facing —
void
— libNtve_gf_CreateUnitsWithDefaultFacing - Create Units With Point Facing —
void
— libNtve_gf_CreateUnitsAtPoint2 - Create Units Facing Angle —
unitgroup
— UnitCreate - Create Units Facing Point —
unitgroup
— libNtve_gf_UnitCreateFacingPoint - Last Created Unit —
unit
— UnitLastCreated - Last Created Units —
unitgroup
— UnitLastCreatedGroup - Original Caster Of Unit —
unit
— UnitGetOriginalCaster - Effect That Created Unit —
string
<gamelink::Effect> — UnitGetOriginalEffect - Replace Unit —
void
— libNtve_gf_ReplaceUnit - Last Replaced Unit —
unit
— libNtve_gf_LastReplacedUnit - Change Owner —
void
— UnitSetOwner - Unit Owner Changes —
void
— TriggerAddEventUnitChangeOwner - Old Unit Owner —
int
— EventUnitOwnerOld - New Unit Owner —
int
— EventUnitOwnerNew - Rescue Unit —
void
— libNtve_gf_RescueUnit - Rescue Unit Group —
void
— libNtve_gf_RescueUnit2 - Kill Unit —
void
— UnitKill - Revive Unit —
void
— UnitRevive - Remove Unit —
void
— UnitRemove - Owner Of Unit —
int
— UnitGetOwner - Unit Is Alive —
bool
— UnitIsAlive - Unit Is Valid —
bool
— UnitIsValid - Unit Group Is Dead —
bool
— libNtve_gf_UnitGroupIsDead - Move Unit Instantly —
void
— UnitSetPosition - Make Unit Face Angle —
void
— UnitSetFacing - Make Unit Face Point —
void
— libNtve_gf_MakeUnitFacePoint - Position Of Unit —
point
— UnitGetPosition - Goal Position Of Unit —
point
— UnitGetGoalPosition - Facing Angle Of Unit —
fixed
— UnitGetFacing - Pause/Unpause Unit —
void
— libNtve_gf_PauseUnit - Pause/Unpause All Units —
void
— UnitPauseAll - Sleep/WakeUp Unit —
void
— libNtve_gf_SleepUnit - Show/Hide Unit —
void
— libNtve_gf_ShowHideUnit - Share Vision of Unit —
void
— libNtve_gf_ShareVisionofUnit - Unit Is Paused —
bool
— libNtve_gf_UnitIsPaused - Unit Is Sleepiing —
bool
— libNtve_gf_UnitIsSleepiing - Unit Is Hidden —
bool
— libNtve_gf_UnitIsHidden - Unit Is Visible To Player —
bool
— libNtve_gf_UnitIsVisibleToPlayer - Set Unit Custom Value —
void
— UnitSetCustomValue - Custom Value Of Unit —
fixed
— UnitGetCustomValue - Unit Enters/Leaves Region —
void
— TriggerAddEventUnitRegion - Triggering Region —
region
— EventUnitRegion - Unit Enters/Leaves Point —
void
— TriggerAddEventUnitRangePoint - Unit Enters/Leaves Range Of Unit —
void
— TriggerAddEventUnitRange - Triggering Range Unit —
unit
— EventUnitRangeUnit - Unit In Region —
bool
— libNtve_gf_UnitInRegion - Triggering Unit —
unit
— EventUnit - Load Unit Model —
void
— UnitLoadModel - Unload Unit Model —
void
— UnitUnloadModel - Agent Of Player For Unit —
unit
— UnitAgent - Change Empty Unit Variables In Events —
void
— UnitEventSetNullVariableInvalid - Name of Unit —
text
— UnitGetName - Ideal Harvester Count —
int
— UnitIdealWorkerCount - Current Harvester Count —
int
— UnitCurrentWorkerCount
# Examples
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:6657
TriggerDebugOutput(1, (StringExternal("Param/Value/1C1C2145") + gf_ActorName(gv_actors[lv_actorIndex].lv_actorID)), false);
gv_actors[lv_actorIndex].lv_preloaded = false;
UnitUnloadModel(gf_ActorUnit(gv_actors[lv_actorIndex].lv_actorID));
}
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:8231
for ( ; autoF63B25EA_u <= UnitGroupCount(autoF63B25EA_g, c_unitCountAll) ; autoF63B25EA_u += BoolToInt(lv_pickedUnit == UnitGroupUnit(autoF63B25EA_g, autoF63B25EA_u)) ) {
lv_pickedUnit = UnitGroupUnit(autoF63B25EA_g, autoF63B25EA_u);
UnitUnloadModel(lv_pickedUnit);
}
}
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2map — MapScript.galaxy:6657
TriggerDebugOutput(1, (StringExternal("Param/Value/1C1C2145") + gf_ActorName(gv_actors[lv_actorIndex].lv_actorID)), false);
gv_actors[lv_actorIndex].lv_preloaded = false;
UnitUnloadModel(gf_ActorUnit(gv_actors[lv_actorIndex].lv_actorID));
}
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2map — MapScript.galaxy:8231
for ( ; autoF63B25EA_u <= UnitGroupCount(autoF63B25EA_g, c_unitCountAll) ; autoF63B25EA_u += BoolToInt(lv_pickedUnit == UnitGroupUnit(autoF63B25EA_g, autoF63B25EA_u)) ) {
lv_pickedUnit = UnitGroupUnit(autoF63B25EA_g, autoF63B25EA_u);
UnitUnloadModel(lv_pickedUnit);
}
}
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zstorychar.sc2map/MapScript.galaxy:809
SoundtrackPlay(PlayerGroupAll(), c_soundtrackCategoryMusic, "ZExpedition01MusicCutscene00_KerriganMeetsIzsha", c_soundtrackCueAny, c_soundtrackIndexAny, false);
lib281DEC45_gf_PlayScriptedConversation("zScripted_ZAdjutantIntro", c_conversationSkipSimple, lib281DEC45_ge_SwarmStoryFadeStyle_FadeOutOnSkip, null);
UnitUnloadModel(UnitFromId(53));
return true;
}
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zstoryexpedition.sc2map/MapScript.galaxy:811
SoundtrackPlay(PlayerGroupAll(), c_soundtrackCategoryMusic, "ZExpedition01MusicCutscene00_KerriganMeetsIzsha", c_soundtrackCueAny, c_soundtrackIndexAny, false);
lib281DEC45_gf_PlayScriptedConversation("zScripted_ZAdjutantIntro", c_conversationSkipSimple, lib281DEC45_ge_SwarmStoryFadeStyle_FadeOutOnSkip, null);
UnitUnloadModel(UnitFromId(36));
return true;
}
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zstorychar.sc2map — MapScript.galaxy:809
SoundtrackPlay(PlayerGroupAll(), c_soundtrackCategoryMusic, "ZExpedition01MusicCutscene00_KerriganMeetsIzsha", c_soundtrackCueAny, c_soundtrackIndexAny, false);
lib281DEC45_gf_PlayScriptedConversation("zScripted_ZAdjutantIntro", c_conversationSkipSimple, lib281DEC45_ge_SwarmStoryFadeStyle_FadeOutOnSkip, null);
UnitUnloadModel(UnitFromId(53));
return true;
}
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zstoryexpedition.sc2map — MapScript.galaxy:811
SoundtrackPlay(PlayerGroupAll(), c_soundtrackCategoryMusic, "ZExpedition01MusicCutscene00_KerriganMeetsIzsha", c_soundtrackCueAny, c_soundtrackIndexAny, false);
lib281DEC45_gf_PlayScriptedConversation("zScripted_ZAdjutantIntro", c_conversationSkipSimple, lib281DEC45_ge_SwarmStoryFadeStyle_FadeOutOnSkip, null);
UnitUnloadModel(UnitFromId(36));
return true;
}
campaigns/swarmstoryutil.sc2mod — base.sc2data/Lib281DEC45.galaxy:301
for ( ; autoD711EDC9_u <= UnitGroupCount(autoD711EDC9_g, c_unitCountAll) ; autoD711EDC9_u += BoolToInt(lv_indexUnit == UnitGroupUnit(autoD711EDC9_g, autoD711EDC9_u)) ) {
lv_indexUnit = UnitGroupUnit(autoD711EDC9_g, autoD711EDC9_u);
UnitUnloadModel(lv_indexUnit);
}
ConsoleCommand("resourceclean", true, true);
campaigns/swarmstoryutil.sc2mod — base.sc2data/Lib281DEC45.galaxy:2085
for ( ; autoE1815EB8_u <= UnitGroupCount(autoE1815EB8_g, c_unitCountAll) ; autoE1815EB8_u += BoolToInt(lv_indexUnit == UnitGroupUnit(autoE1815EB8_g, autoE1815EB8_u)) ) {
lv_indexUnit = UnitGroupUnit(autoE1815EB8_g, autoE1815EB8_u);
UnitUnloadModel(lv_indexUnit);
}
Wait(1.0, c_timeGame);
campaigns/swarmstoryutil.sc2mod — base.sc2data/Lib281DEC45.galaxy:2616
UnitCreate(1, lp_unitType, c_unitCreateIgnorePlacement, 0, lp_location, lp_facing);
if ((lib281DEC45_gv_zSS_UnitsLoaded == false)) {
UnitUnloadModel(UnitLastCreated());
}
else {
campaigns/swarmstoryutil.sc2mod — base.sc2data/Lib281DEC45.galaxy:2646
}
else {
UnitUnloadModel(lp_unit);
UnitGroupRemove(lib281DEC45_gv_zSS_PlanetSetUnits, lp_unit);
UnitGroupRemove(lib281DEC45_gv_zSS_VisibleUnits, lp_unit);
campaigns/swarmstoryutil.sc2mod — base.sc2data/Lib281DEC45.galaxy:2700
}
else {
UnitUnloadModel(lv_indexUnit);
}
}
campaigns/swarmstoryutil.sc2mod — base.sc2data/Lib281DEC45.galaxy:4810
UnitCreate(1, lp_unitType, c_unitCreateIgnorePlacement, 1, lp_location, 270.0);
if ((lib281DEC45_gv_zSS_UnitsLoaded == false)) {
UnitUnloadModel(UnitLastCreated());
}
else {
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/void/pstory01.sc2map/MapScript.galaxy:3490
}
UnitUnloadModel(gv_uNITBridgeSet00);
return true;
}
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/pstory01.sc2map — MapScript.galaxy:3490
}
UnitUnloadModel(gv_uNITBridgeSet00);
return true;
}
campaigns/voidstory.sc2campaign — base.sc2data/TriggerLibs/VoidCampaignStoryLib.galaxy:1203
}
UnitUnloadModel(UnitLastCreated());
libNtve_gf_ShowHideUnit(UnitLastCreated(), false);
}
campaigns/voidstory.sc2campaign — base.sc2data/TriggerLibs/VoidCampaignStoryLib.galaxy:1763
UnitGroupRemove(libVCST_gv_pS_RoomUnits[(lp_room)], lp_unit);
if ((libVCST_gf_CurrentRoom() == lp_room)) {
UnitUnloadModel(lp_unit);
}
campaigns/voidstory.sc2campaign — base.sc2data/TriggerLibs/VoidCampaignStoryLib.galaxy:2262
if (lv_indexUnit == null) { break; }
if ((UnitGroupHasUnit(libVCST_gv_pS_RoomUnits[(libVCST_gv_pS_CurrentRoom)], lv_indexUnit) == false)) {
UnitUnloadModel(lv_indexUnit);
}
mods/missionpacks/novacampaign.sc2mod — base.sc2data/LibNCST.galaxy:1095
}
UnitUnloadModel(UnitLastCreated());
libNtve_gf_ShowHideUnit(UnitLastCreated(), false);
}
mods/missionpacks/novacampaign.sc2mod — base.sc2data/LibNCST.galaxy:1575
UnitGroupRemove(libNCST_gv_nS_RoomUnits[(lp_room)], lp_unit);
if ((libNCST_gf_CurrentRoom() == lp_room)) {
UnitUnloadModel(lp_unit);
}
mods/missionpacks/novacampaign.sc2mod — base.sc2data/LibNCST.galaxy:1945
lv_indexUnit = UnitGroupUnit(auto4BA2BDE2_g, auto4BA2BDE2_u);
if ((UnitGroupHasUnit(libNCST_gv_nS_RoomUnits[(libNCST_gv_nS_CurrentRoom)], lv_indexUnit) == false)) {
UnitUnloadModel(lv_indexUnit);
}