# Goal Position Of Unit

Grammar — Goal Position of u
FlagsNative | Function

Returns the goal (target) position of a unit.

# Arguments

  • unit — Unit

Returns — point

native point UnitGetGoalPosition(unit inUnit);

Category: Unit / Basic

# Examples

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/pulnar01.sc2map/MapScript.galaxy:473

        auto2439952A_var = UnitGroupUnitFromEnd(auto2439952A_g, auto2439952A_u);
        if (auto2439952A_var == null) { break; }
        if ((AIUnitGetWave(auto2439952A_var) == null) && (RegionContainsPoint(gv_celestialLocks[lp_index].lv_defenseRegion, UnitGetGoalPosition(auto2439952A_var)) == true)) {
            AIRemoveUnitFromAnyWavesAndSetHome(auto2439952A_var, PlayerStartLocation(UnitGetOwner(auto2439952A_var)));
            UnitIssueOrder(auto2439952A_var, OrderTargetingPoint(null, PlayerStartLocation(UnitGetOwner(auto2439952A_var))), c_orderQueueReplace);

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/pulnar01.sc2mapMapScript.galaxy:473

        auto2439952A_var = UnitGroupUnitFromEnd(auto2439952A_g, auto2439952A_u);
        if (auto2439952A_var == null) { break; }
        if ((AIUnitGetWave(auto2439952A_var) == null) && (RegionContainsPoint(gv_celestialLocks[lp_index].lv_defenseRegion, UnitGetGoalPosition(auto2439952A_var)) == true)) {
            AIRemoveUnitFromAnyWavesAndSetHome(auto2439952A_var, PlayerStartLocation(UnitGetOwner(auto2439952A_var)));
            UnitIssueOrder(auto2439952A_var, OrderTargetingPoint(null, PlayerStartLocation(UnitGetOwner(auto2439952A_var))), c_orderQueueReplace);

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:19371

    UnitCreateEffectUnit(lv_rexxar, "RexxarMishaApplyBasicAttackDamageResponseController", lv_misha);
    UnitCreateEffectUnit(lv_misha, "RexxarMishaApplyBasicAttackDamageResponseController2", lv_rexxar);
    libNtve_gf_MakeUnitFacePoint(lv_misha, PointWithOffset(UnitGetGoalPosition(lv_rexxar), 0.0, -5.0), 0.0);
    if ((UnitGetType(libGame_gv_players[lv_rexxarPlayer].lv_heroUnit) == "HeroAbathur")) {
        lv_rexxar = libGame_gv_players[lv_rexxarPlayer].lv_activeVehicle;

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:27274

    if ((UnitIsValid(lv_purifier) == true) && (TechTreeUpgradeCount(lv_p, "ZeratulArtifactTier3_RoboticsBay", c_techCountCompleteOnly) >= 1)) {
        lv_spawnPoint = UnitGetPosition(lv_u);
        lv_goal = UnitGetGoalPosition(lv_u);
        if ((lv_spawnPoint != lv_goal)) {
            lv_mainAngel = AngleBetweenPoints(lv_spawnPoint, lv_goal);

mods/testmods/autopve.stormmodbase.stormdata/Lib1035AFB3.galaxy:357


    if ((libCore_gf_IsAbilityOnCooldown(lib1035AFB3_gv_johanna, "CrusaderPunish") == false)) {
        UnitIssueOrder(lib1035AFB3_gv_johanna, OrderTargetingPoint(AbilityCommand("CrusaderPunish", 0), UnitGetGoalPosition(lib1035AFB3_gv_johanna)), c_orderQueueReplace);
        return true;
    }

mods/testmods/autopve.stormmodbase.stormdata/Lib1035AFB3.galaxy:365

    }
    else if ((libCore_gf_IsAbilityOnCooldown(lib1035AFB3_gv_johanna, "CrusaderShieldGlare") == false)) {
        UnitIssueOrder(lib1035AFB3_gv_johanna, OrderTargetingPoint(AbilityCommand("CrusaderShieldGlare", 0), UnitGetGoalPosition(lib1035AFB3_gv_johanna)), c_orderQueueReplace);
        return true;
    }

mods/testmods/autopve.stormmodbase.stormdata/Lib1035AFB3.galaxy:394

    UnitIssueOrder(lib1035AFB3_gv_azmodan, Order(AbilityCommand("AzmodanAllShallBurnCancel", 0)), c_orderQueueReplace);
    if ((libCore_gf_IsAbilityOnCooldown(lib1035AFB3_gv_azmodan, "AzmodanGlobeOfAnnihilation") == false)) {
        UnitIssueOrder(lib1035AFB3_gv_azmodan, OrderTargetingPoint(AbilityCommand("AzmodanGlobeOfAnnihilation", 0), UnitGetGoalPosition(lib1035AFB3_gv_azmodan)), c_orderQueueReplace);
        return true;
    }

mods/testmods/autopve.stormmodbase.stormdata/Lib1035AFB3.galaxy:398

    }
    else if ((UnitAbilityChargeInfo(lib1035AFB3_gv_azmodan, AbilityCommand("AzmodanSummonDemonWarrior", 0), c_unitAbilChargeCountLeft) >= 1)) {
        UnitIssueOrder(lib1035AFB3_gv_azmodan, OrderTargetingPoint(AbilityCommand("AzmodanSummonDemonWarrior", 0), UnitGetGoalPosition(lib1035AFB3_gv_azmodan)), c_orderQueueReplace);
        return true;
    }

mods/testmods/autopve.stormmodbase.stormdata/Lib1035AFB3.galaxy:402

    }
    else if ((libCore_gf_IsAbilityOnCooldown(lib1035AFB3_gv_azmodan, "AzmodanDemonicInvasion") == false)) {
        UnitIssueOrder(lib1035AFB3_gv_azmodan, OrderTargetingPoint(AbilityCommand("AzmodanDemonicInvasion", 0), UnitGetGoalPosition(lib1035AFB3_gv_azmodan)), c_orderQueueReplace);
        return true;
    }

mods/testmods/autopve.stormmodbase.stormdata/Lib1035AFB3.galaxy:480


    if ((libCore_gf_IsAbilityOnCooldown(lib1035AFB3_gv_nazeebo, "WitchDoctorZombieWall") == false)) {
        UnitIssueOrder(lib1035AFB3_gv_nazeebo, OrderTargetingPoint(AbilityCommand("WitchDoctorZombieWall", 0), UnitGetGoalPosition(lib1035AFB3_gv_nazeebo)), c_orderQueueReplace);
        return true;
    }

mods/testmods/autopve.stormmodbase.stormdata/Lib1035AFB3.galaxy:484

    }
    else if ((libCore_gf_IsAbilityOnCooldown(lib1035AFB3_gv_nazeebo, "WitchDoctorCorpseSpiders") == false)) {
        UnitIssueOrder(lib1035AFB3_gv_nazeebo, OrderTargetingPoint(AbilityCommand("WitchDoctorCorpseSpiders", 0), UnitGetGoalPosition(lib1035AFB3_gv_nazeebo)), c_orderQueueReplace);
        return true;
    }

mods/testmods/autopve.stormmodbase.stormdata/Lib1035AFB3.galaxy:488

    }
    else if ((UnitAbilityChargeInfo(lib1035AFB3_gv_nazeebo, AbilityCommand("WitchDoctorPlagueofToads", 0), c_unitAbilChargeCountLeft) >= 1)) {
        UnitIssueOrder(lib1035AFB3_gv_nazeebo, OrderTargetingPoint(AbilityCommand("WitchDoctorPlagueofToads", 0), UnitGetGoalPosition(lib1035AFB3_gv_nazeebo)), c_orderQueueReplace);
        return true;
    }

mods/testmods/autopve.stormmodbase.stormdata/Lib1035AFB3.galaxy:520

    }
    else if ((libCore_gf_IsAbilityOnCooldown(lib1035AFB3_gv_kelThuzad, "KelThuzadDeathAndDecay") == false)) {
        UnitIssueOrder(lib1035AFB3_gv_kelThuzad, OrderTargetingPoint(AbilityCommand("KelThuzadDeathAndDecay", 0), UnitGetGoalPosition(lib1035AFB3_gv_kelThuzad)), c_orderQueueReplace);
        return true;
    }

mods/testmods/autopve.stormmodbase.stormdata/Lib1035AFB3.galaxy:524

    }
    else if ((libCore_gf_IsAbilityOnCooldown(lib1035AFB3_gv_kelThuzad, "KelThuzadChains") == false)) {
        UnitIssueOrder(lib1035AFB3_gv_kelThuzad, OrderTargetingPoint(AbilityCommand("KelThuzadChains", 0), UnitGetGoalPosition(lib1035AFB3_gv_nazeebo)), c_orderQueueReplace);
        return true;
    }