beako 13 Posted August 11, 2015 Hi all, Does anyone know of a command or short script that check if a unit has line of sight to another unit? I'm trying to get my UAV to target a unit but had to cheat by attaching a laser to the unit instead. I've tried a bunch of things like assignTarget, knowsAbout, forceaFireWeapon of mounter laser and doFire...etc, but had no luck. As a workaround, Now i will remove the attached laser whenever the unit goes out of sight from the UAV. 1 Share this post Link to post Share on other sites
inlesco 233 Posted August 12, 2015 Tried this: https://community.bistudio.com/wiki/lineIntersectsWith ? 1 Share this post Link to post Share on other sites
Heeeere's johnny! 51 Posted August 12, 2015 If you only need to know IF the unit can see the other one, you may also like this one: https://community.bistudio.com/wiki/lineIntersects Returns TRUE if something intersects the line of sight and FALSE if not. But be aware that the hard coded maximum distance is 1.000m (according to BIKI). Share this post Link to post Share on other sites
Grumpy Old Man 3547 Posted August 12, 2015 Also don't miss the fact that lineIntersects is using position ASL, using eyepos works fine for infantry. Using it a lot for various stuff. Cheers 1 Share this post Link to post Share on other sites
Ed! 13 Posted August 12, 2015 lineIntersects won't detect all rocks, trees and fiolage. You can use terrainIntersectASL together with lineIntersects for that matter. I assume lineIntersects detects objects with cfg classes that are spawnable while terrainIntersectASL detects stuff related to the map itself which aren't spawnable. Share this post Link to post Share on other sites