{"name":"flyInHeight","operator":null,"title":"flyInHeight","type":"command","url":"https://community.bistudio.com/wiki/flyInHeight","revid":376081,"updated":"2025-08-01T17:11:58Z","groups":["Object Manipulation"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"local","effect":"global","server_exec":false},"exec":null,"description":"Sets the flying altitude for aircraft relatively to the ground surface. Avoid too low altitudes, as helicopters and planes won't evade trees and obstacles on the ground. The default flying altitude is 100 meters. The minimum height is 20 meters.\n\n> [!NOTE]\n> Height measurement is relative to the pilot and can be approximated with `ASLToAGL eyePos driver _aircraft;`.","syntaxes":[{"syntax":"aircraft flyInHeight altitude","since":null,"effect":null,"exec":null,"params":[{"name":"aircraft","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"aircraft: Object"},{"name":"altitude","type":"Number","optional":false,"default":null,"description":"flying altitude in meters","types":["Number"],"since":null,"text":"altitude: Number - flying altitude in meters"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"aircraft","types":["Object"]},"right":{"text":"altitude","types":["Number"]}},{"syntax":"aircraft flyInHeight [altitude, forced]","since":"arma3 2.14","effect":null,"exec":null,"params":[{"name":"aircraft","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"aircraft: Object"},{"name":"altitude","type":"Number","optional":false,"default":null,"description":"flying altitude in meters","types":["Number"],"since":null,"text":"altitude: Number - flying altitude in meters"},{"name":"forced","type":"Boolean","optional":false,"default":null,"description":"true to force altitude in all cases, false to behave like main syntax","types":["Boolean"],"since":null,"text":"forced: Boolean - true to force altitude in all cases, false to behave like main syntax"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"aircraft","types":["Object"]},"right":{"text":"[altitude, forced]","types":["Array"]}}],"examples":[{"text":"```sqf\n_helicopter flyInHeight 40;\n```","code":["_helicopter flyInHeight 40;"]},{"text":"```sqf\n// for altitudes below 10m\n_helicopter flyInHeight 5;            // helicopter will land\n_helicopter flyInHeight [5, true];    // helicopter will hover at 5m altitude\n\n// on a landed helicopter\n_helicopter flyInHeight 50;            // helicopter will not move until a waypoint is added\n_helicopter flyInHeight [50, true];    // helicopter will start to rise immediately\n```","code":["// for altitudes below 10m\n_helicopter flyInHeight 5;\t\t\t// helicopter will land\n_helicopter flyInHeight [5, true];\t// helicopter will hover at 5m altitude\n\n// on a landed helicopter\n_helicopter flyInHeight 50;\t\t\t// helicopter will not move until a waypoint is added\n_helicopter flyInHeight [50, true];\t// helicopter will start to rise immediately"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["flyInHeightASL"],"notes":[{"user":"Hardrock","date":"2006-08-04T12:50:00Z","text":"*Notes from before the conversion:*\n\nFrom Operation Flashpoint v1.80 - flyInHeight now affects not only helicopters, but also planes."},{"user":"Kronzky","date":"2008-12-16T01:34:00Z","text":"A flyInHeight of 0 will keep the chopper pinned to the ground, even when the engines have been started."},{"user":"Jtgibson","date":"2009-04-11T00:53:00Z","text":"If a helo has no waypoints, it will assume a low hover without regard to this setting.\n\n> [!IMPORTANT]\n> This comment does not apply to the alternative syntax."},{"user":"OverlordZorn","date":"2025-08-01T17:11:58Z","text":"As of 2.20:\n\n- when altitude is greater or equal 10, collision avoidance will maintain priority and the rotary airframe stays around 20~35 meters ATL, depending on nearby objects.\n\n- when altitude is lower then 10, for example, 9.99999, it seems that collision avoidance is disabled and the airframe will maintain the desired ATL."}],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Object Manipulation","Introduced with Operation Flashpoint version 1.00","Operation Flashpoint: Elite: Scripting Commands","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Scripting Commands: Global Effect","Take On Helicopters: Scripting Commands"]}