pappagoat 6 Posted October 22, 2019 Hello, I'm using BIS_fnc_ambientFlyBy to spawn aircraft that fly a set route. I am trying to find out how to get the unit name of the aircraft so that I can then do things to the spawned unit, such as limit its speed, set velocity and teleport AI into the aircraft. Does anyone have any ideas? Share this post Link to post Share on other sites
beno_83au 1369 Posted October 23, 2019 Use nearestObject with "Air" for the type to get the aircraft. 1 Share this post Link to post Share on other sites
Mr H. 402 Posted October 23, 2019 but that's not what Bis_fnc_flyby is for, you should use BIS_fnc_spawnVehicle instead 1 Share this post Link to post Share on other sites
pappagoat 6 Posted October 24, 2019 On 10/23/2019 at 4:09 AM, Mr H. said: but that's not what Bis_fnc_flyby is for, you should use BIS_fnc_spawnVehicle instead No, I know what it is and I wanted to use flyby. It''s for a repetitive AI paradrop. Share this post Link to post Share on other sites
Mr H. 402 Posted October 24, 2019 But why ? BIS_fnc_spawnVehicle returns the vehicle, can spawn it in the air and flying and gives you more control! On 10/23/2019 at 8:47 AM, beno_83au said: Use nearestObject with "Air" for the type to get the aircraft will work but it's way messier and more complicated to set up, plus it might detct the wrong aircraft if one is passing you by closer Share this post Link to post Share on other sites
pierremgi 4923 Posted October 24, 2019 where do you use this function? In a trigger?, in a script? At least you know the class and the position of what you spawn. So, as @beno_83au wrote, a nearestObject [position, type] should work. you can even add a captive condition as this vehicle is captive. 1 Share this post Link to post Share on other sites
beno_83au 1369 Posted October 24, 2019 5 hours ago, Mr H. said: will work but it's way messier and more complicated to set up, plus it might detct the wrong aircraft if one is passing you by closer No way, it's only 1 line, easy as. Plus, if you run this using the spawn position immediately after creating the aircraft it'll be fine. Share this post Link to post Share on other sites