# Unload Unit Model

Grammar — Unload model for u
FlagsNative | Action

Unloads a unit model.

# Arguments

  • unit — Unit

Returns — void

native void UnitUnloadModel(unit inUnit);

Category: Unit / Basic

# Examples

campaigns/liberty.sc2campaignbase.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.sc2campaignbase.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.sc2mapMapScript.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.sc2mapMapScript.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.sc2campaignbase.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.sc2campaignbase.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.sc2mapMapScript.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.sc2mapMapScript.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.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.sc2data/Lib281DEC45.galaxy:2646

    }
    else {
        UnitUnloadModel(lp_unit);
        UnitGroupRemove(lib281DEC45_gv_zSS_PlanetSetUnits, lp_unit);
        UnitGroupRemove(lib281DEC45_gv_zSS_VisibleUnits, lp_unit);

campaigns/swarmstoryutil.sc2modbase.sc2data/Lib281DEC45.galaxy:2700

            }
            else {
                UnitUnloadModel(lv_indexUnit);
            }
        }

campaigns/swarmstoryutil.sc2modbase.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.sc2campaignbase.sc2maps/maps/campaign/void/pstory01.sc2map/MapScript.galaxy:3490

    }

    UnitUnloadModel(gv_uNITBridgeSet00);
    return true;
}

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/pstory01.sc2mapMapScript.galaxy:3490

    }

    UnitUnloadModel(gv_uNITBridgeSet00);
    return true;
}

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignStoryLib.galaxy:1203

    }

    UnitUnloadModel(UnitLastCreated());
    libNtve_gf_ShowHideUnit(UnitLastCreated(), false);
}

campaigns/voidstory.sc2campaignbase.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.sc2campaignbase.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.sc2modbase.sc2data/LibNCST.galaxy:1095

    }

    UnitUnloadModel(UnitLastCreated());
    libNtve_gf_ShowHideUnit(UnitLastCreated(), false);
}

mods/missionpacks/novacampaign.sc2modbase.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.sc2modbase.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);
        }