# Unit Targetable Check

Grammaru is targetable as plane
FlagsNative | Function

Returns true if a unit is targetable.

# Arguments

  • unit — Unit
  • int<preset::UnitPlane> — Plane

Returns — bool

native bool UnitTestPlane(unit inUnit, int inPlane);

Category: Unit / Properties

# Examples

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/ttosh03b.sc2map/MapScript.galaxy:2558

        }

        if (!((UnitTestPlane(EventUnitDamageSourceUnit(), c_planeGround) == true))) {
            return false;
        }

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/ttosh03b.sc2map/MapScript.galaxy:3844

        }

        if (!((UnitTestPlane(EventUnitDamageSourceUnit(), c_planeAir) == true))) {
            return false;
        }

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/ttosh03b.sc2map/MapScript.galaxy:3888

        }

        if (!((UnitTestPlane(EventUnitDamageSourceUnit(), c_planeAir) == true))) {
            return false;
        }

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/ttychus01.sc2map/MapScript.galaxy:1341

        }

        if (!((UnitTestPlane(EventUnit(), c_planeAir) == false))) {
            return false;
        }

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/ttychus01.sc2map/MapScript.galaxy:1421

        }

        if (!((UnitTestPlane(EventUnit(), c_planeAir) == false))) {
            return false;
        }

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttosh03b.sc2mapMapScript.galaxy:2558

        }

        if (!((UnitTestPlane(EventUnitDamageSourceUnit(), c_planeGround) == true))) {
            return false;
        }

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttosh03b.sc2mapMapScript.galaxy:3844

        }

        if (!((UnitTestPlane(EventUnitDamageSourceUnit(), c_planeAir) == true))) {
            return false;
        }

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttosh03b.sc2mapMapScript.galaxy:3888

        }

        if (!((UnitTestPlane(EventUnitDamageSourceUnit(), c_planeAir) == true))) {
            return false;
        }

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttychus01.sc2mapMapScript.galaxy:1341

        }

        if (!((UnitTestPlane(EventUnit(), c_planeAir) == false))) {
            return false;
        }

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttychus01.sc2mapMapScript.galaxy:1421

        }

        if (!((UnitTestPlane(EventUnit(), c_planeAir) == false))) {
            return false;
        }

campaigns/swarm.sc2campaignbase.sc2maps/maps/campaign/swarm/zzerus02.sc2map/MapScript.galaxy:2731

        }

        if (!((UnitTestPlane(EventUnitTarget(), c_planeGround) == true))) {
            return false;
        }

campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zzerus02.sc2mapMapScript.galaxy:2731

        }

        if (!((UnitTestPlane(EventUnitTarget(), c_planeGround) == true))) {
            return false;
        }

mods/core.sc2modbase.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:1633

            return;
        }
        if (airOnly == false || UnitTestPlane(curTarget, c_planeAir) == true) {
            OrderSetTargetUnit(ord, curTarget);
            if (UnitOrderIsValid(aiUnit, ord)) {

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:1580

            return;
        }
        if (airOnly == false || UnitTestPlane(curTarget, c_planeAir) == true) {
            OrderSetTargetUnit(ord, curTarget);
            if (UnitOrderIsValid(aiUnit, ord)) {