Attach the script to the soldier.
This is a base script, you can work with, play with the values to get different distances, and behaviors.
Script is well commented, so you know whats values you has to deal with.
I've exagerate dist in the vid, but you can change this, as pointed above. Trial and error is the key.
hth
3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz
OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4