ZU23 2 Posted May 26, 2017 Hello, Im trying to make a command that spawns an AI but also kills him when hes at a certain distance from the player, however the distance thing doesnt seem to work. _group = createGroup WEST; _unit = _group createUnit ["B_Soldier_F", position player, [], 1, "FORM"]; _meters = player distance _unit; if (_meters >= 10) then {_unit setDamage 1;}; Share this post Link to post Share on other sites
crewt 31 Posted May 26, 2017 That's because the distance is to small. You check the distance only once when the unit was created. Add a loop and keep checking the distance. Share this post Link to post Share on other sites
pierremgi 4906 Posted May 26, 2017 Normal. You're spawning the unit on player's position. Share this post Link to post Share on other sites