Notes from before the conversion:
From Operation Flashpoint v1.80 - flyInHeight now affects not only helicopters, but also planes.
Command in Object Manipulation
Also available as Markdown and JSON, or read the original wiki page.
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.
Note
Height measurement is relative to the pilot and can be approximated with
ASLToAGL eyePos driver _aircraft;.
aircraft flyInHeight altitude
Parameters:
Returns: Nothing
since arma3 2.14
aircraft flyInHeight [altitude, forced]
Parameters:
aircraft: Objectaltitude: Number - flying altitude in metersforced: Boolean - true to force altitude in all cases, false to behave like main syntaxReturns: Nothing
_helicopter flyInHeight 40;
// for altitudes below 10m
_helicopter flyInHeight 5; // helicopter will land
_helicopter flyInHeight [5, true]; // helicopter will hover at 5m altitude
// on a landed helicopter
_helicopter flyInHeight 50; // helicopter will not move until a waypoint is added
_helicopter flyInHeight [50, true]; // helicopter will start to rise immediately
Notes from before the conversion:
From Operation Flashpoint v1.80 - flyInHeight now affects not only helicopters, but also planes.
A flyInHeight of 0 will keep the chopper pinned to the ground, even when the engines have been started.
If a helo has no waypoints, it will assume a low hover without regard to this setting.
Important
This comment does not apply to the alternative syntax.
As of 2.20:
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.
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.