# Wave Target Unit

Grammar — Create a new wave target set to attack the folllowing unit unit
FlagsNative | Function

Creates a new wave target set to attack a unit. Returns the wave target.

# Arguments

  • unit — Unit

Returns — wavetarget

native wavetarget AIWaveTargetUnit(unit u);

Category: AI Advanced / Waves / Functions

# Examples

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:316

    if (state != c_waveStateClearObs || obstruction != oldTarget) {
DebugAIPlayerWave(player, "clearobs2 set clear obstruction = clear obstruction");
        AIWaveSetType(w, c_waveStateClearObs, AIWaveTargetUnit(obstruction));
    }
}

mods/warcoop/warmeleeai.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:399

    if (state != c_waveStateClearObs || obstruction != oldTarget) {
DebugAIPlayerWave(player, "clearobs2 set clear obstruction = clear obstruction");
        AIWaveSetType(w, c_waveStateClearObs, AIWaveTargetUnit(obstruction));
    }
}