Whenever one unit attacks another unit, the attacked unit should be knocked backwards. Right now it works perfectly, but for one problem.
The problem is, the attacked unit can be knocked through walls (and other destructibles) and over cliffs. It can even get stuck in a cliff. I would like to make it so the unit will be knocked backwards until it reaches a pathing blocker of some kind. Thanks for the help!
Trigger:
- Knockback Actual
- Events
- Time - Every 0.04 seconds of game time
- Conditions
- Actions
- Unit Group - Pick every unit in ZombiesKnockback and do (Actions)
- Loop - Actions
- Set Temp_Point = ((Position of (Picked unit)) offset by 20.00 towards (Real((Custom value of (Picked unit)))) degrees)
- Custom script: call SetUnitX ( GetEnumUnit ( ) , GetLocationX ( udg_Temp_Point ) )
- Custom script: call SetUnitY ( GetEnumUnit ( ) , GetLocationY ( udg_Temp_Point ) )
- Custom script: call RemoveLocation ( udg_Temp_Point )
- Loop - Actions
- Unit Group - Pick every unit in ZombiesKnockback and do (Actions)
- Events
The problem is, the attacked unit can be knocked through walls (and other destructibles) and over cliffs. It can even get stuck in a cliff. I would like to make it so the unit will be knocked backwards until it reaches a pathing blocker of some kind. Thanks for the help!