• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Solved] Make units only attack what is on their path and ignore the rest ?

Level 2
Joined
Jul 6, 2026
Messages
2
I'm making a wave-based tower defense game.

Enemy units spawn at the right of the map and are ordered to Attack-Move toward a region at the left.

My goal is for them to attack any enemy they encounter along their path while moving toward their destination.

The problem is that whenever a defensive building attacks one of these units, the unit immediately abandons its current target and rushes toward the building that attacked it. It seems there's a built-in retaliation/aggro system that gives priority to the source of incoming damage.

Is there a way to disable or ignore this retaliation behavior so units simply attack whatever is directly in their path instead of chasing whatever attacked them? I'd like to avoid making defensive structures invulnerable because those defensive structures should also be attacked when they are in the path.

Thanks in advance
 
Welcome to the Hive,

you might get somewhat decent results, by altering the gameplay constants for aggro range and lowering the acquisition range of your spawns drastically. Sadly, the constants would affect all units.
 
I think a better way to do this without fighting with the built-in target acquisition is by just using walk commands and not attack ground. then you will need to set up a separate system to check if their path is blocked, and if so - attack the blocking unit. there are already some existing systems that can probably help you out with this - check the spells and systems section. (one example - IsPointWalkable)
 
Back
Top