thy_ 132 Posted May 12, 2021 Hey, folks I have a trigger that its goal is: Condition: If any unit of a specific GROUP get close < 5 meters to the target; On Activation: hint "Some of of the group is around the target"; The question arounds only regarding the condition. I am not sure what is my mistake: I've tried: (group01 distance bluTarget) < 5; (group group01 distance bluTarget) < 5; (units group01 distance bluTarget) < 5; {(units group group01) distance bluTarget} < 5; Can you put light here? Thanks in advance. Share this post Link to post Share on other sites
pierremgi 4739 Posted May 12, 2021 distance works between objects and/or positions. units group01 findIf {_x distance bluTarget < 5} > -1 you can use also distanceSqr (so <25) for faster check. For side... allUnits findIf {side _x == EAST && _x distanceSqr bluTarget < 25} > 1 (just a little bit resource consuming with many units). Depending on your scenario and the way you check it. See https://community.bistudio.com/wiki/setTriggerInterval 1 Share this post Link to post Share on other sites
thy_ 132 Posted May 12, 2021 @pierremgi, everything working fine here! 😄 Btw, making some tests, I noticed these codes below doesn't work correctly when only the leader gets close to the target: leader group01 findIf {_x distance bluTarget < 5} > -1; leader units group01 findIf {_x distance bluTarget < 5} > -1; Share this post Link to post Share on other sites
pierremgi 4739 Posted May 12, 2021 leader (of a group/units) is an object, not an array. FindIf applies to an array. If you have to check this unit only, it's easy : leader group01 distance bluTarget < 5 1 Share this post Link to post Share on other sites