Get in range to target

I wonder if i can use this A* pro to achieve what i need.

Lets say my unit has huge shooting range, and if i select my unit and right click on an enemy, i do not need a path for the unit to reach the enemy, i just need a path for the unit to get close enough to enemy so it can shoot, even the path is a dead end, as long as the unit can stand there and shoot, it should be valid.

IE unit size is 1x1 tile in size, and it can shoot 200 tiles away, i need the closest point this unit can reach that is exactly 200 tiles away from the target. Is it possible ?

If using the RichAI.cs script to control your agents, there’s an “End reached distance” value you can set.

But for my game we have a special use case and I had to implement our on controller script and distance checks.

1 Like