Ignition Posted December 27, 2023 Posted December 27, 2023 (edited) getDetectedTargets() retains the detected targets and never resets itself. Once it detects a target it will retain it "forever" even if it's way beyond the detection range. I tested it with enum 1, 4 and nil and it's the same. local SAM = "Ground-1-1" local maxRange = 30000 local controller_unit = Unit.getController(Unit.getByName(SAM)) local tDetectedTargets = controller_unit:getDetectedTargets() for i, v in ipairs(tDetectedTargets) do if v then local objName = Object.getName(tDetectedTargets[i].object) if Unit.getByName(objName) then local coal = Unit.getByName(objName):getCoalition() if coal == 2 then local coord1 = Unit.getByName(SAM):getPoint() local coord2 = Unit.getByName(objName):getPoint() local distancia = Distancia(nil, nil, coord1, coord2) if distancia < maxRange then a = 1 else a = 0 end end end end end Edited December 27, 2023 by Ignition
Flappie Posted January 2, 2024 Posted January 2, 2024 Hi. The issue was reported internally a few weeks ago. ---
Ignition Posted January 2, 2024 Author Posted January 2, 2024 1 hour ago, Flappie said: Hi. The issue was reported internally a few weeks ago. thanks!
Pikey Posted May 27, 2024 Posted May 27, 2024 This should be solved in public builds now. 2 2 ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *
Ignition Posted May 27, 2024 Author Posted May 27, 2024 9 hours ago, Pikey said: This should be solved in public builds now. great! Thanks
Recommended Posts