# Turn Camera Height Displacement On/Off

Grammar — Turn camera height displacement enable for player player
FlagsNative | Action

When this is enabled, and the camera is following a flying unit, the camera will adjust its height to ensure the flying unit stays visible when the camera zooms in.

# Arguments

Returns — void

native void CameraUseHeightDisplacement(
	int player,
	bool value,
);

Category: Camera / Camera Tricks

# Examples

mods/heroesbrawlmods/brawlmapmods/lunarfestival.stormmodbase.stormdata/LibLNYF.galaxy:807

        UnitSelect(libLNYF_gv_player_Camera_InvisibleUnit[lv_i], lv_i, true);
        libGame_gf_CameraPanCameraForPlayerAndUpdateMapBoundsIfNecessary(lv_i, UnitGetPosition(UnitLastCreated()), 0.0, -1, 0.0, false);
        CameraUseHeightDisplacement(lv_i, true);
        CameraFollowUnitGroup(lv_i, libNtve_gf_ConvertUnitToUnitGroup(UnitLastCreated()), true, false);
        PlayerOptionOverride(lv_i, "camerafollow", "1");

mods/heroesbrawlmods/brawlmapmods/lunarfestival.stormmodbase.stormdata/LibLNYF.galaxy:823

    libLNYF_gv_observer_InvisibleUnit = UnitLastCreated();
    libGame_gf_CameraPanCameraForPlayerAndUpdateMapBoundsIfNecessary(libCore_gv_oBSERVER_ObserverUIPlayer, UnitGetPosition(UnitLastCreated()), 0.0, -1, 0.0, false);
    CameraUseHeightDisplacement(libCore_gv_oBSERVER_ObserverUIPlayer, true);
    CameraFollowUnitGroup(libCore_gv_oBSERVER_ObserverUIPlayer, libNtve_gf_ConvertUnitToUnitGroup(UnitLastCreated()), true, false);
    PlayerOptionOverride(libCore_gv_oBSERVER_ObserverUIPlayer, "camerafollow", "1");

mods/heroesbrawlmods/brawlmapmods/lunarfestival.stormmodbase.stormdata/LibLNYF.galaxy:1140

    libGame_gv_players[lv_playerID].lv_cameraPlayerHasControl = false;
    libGame_gv_players[lv_playerID].lv_cameraPlayerUnitGroupToFocusOn = libNtve_gf_ConvertUnitToUnitGroup(libGame_gv_players[lv_playerID].lv_heroUnit);
    CameraUseHeightDisplacement(lv_playerID, true);
    libGame_gf_CameraUpdateCameraForPlayer(lv_playerID);
    libNtve_gf_SendActorMessageToUnit(libGame_gv_players[lv_playerID].lv_heroUnit, "SetShowStatusBar");

mods/heroesbrawlmods/brawlmapmods/lunarfestival.stormmodbase.stormdata/LibLNYF.galaxy:1148

    UnitSelect(libGame_gv_players[1].lv_heroUnit, 0, true);
    libGame_gf_CameraPanCameraForPlayerAndUpdateMapBoundsIfNecessary(libCore_gv_oBSERVER_ObserverUIPlayer, UnitGroupCenterOfGroup(libGame_gv_players[1].lv_cameraCurrentTargetGroup), 0.0, -1, 0.0, false);
    CameraUseHeightDisplacement(libCore_gv_oBSERVER_ObserverUIPlayer, true);
    CameraFollowUnitGroup(libCore_gv_oBSERVER_ObserverUIPlayer, libGame_gv_players[1].lv_cameraCurrentTargetGroup, true, false);
    PlayerOptionOverride(libCore_gv_oBSERVER_ObserverUIPlayer, "camerafollow", "1");

mods/heroesbrawlmods/brawlmapmods/lunarfestival.stormmodbase.stormdata/LibLNYF.galaxy:2035

    libGame_gv_players[libGame_gf_DebugHeroSwappedPlayer()].lv_cameraPlayerHasControl = false;
    libGame_gv_players[libGame_gf_DebugHeroSwappedPlayer()].lv_cameraPlayerUnitGroupToFocusOn = libNtve_gf_ConvertUnitToUnitGroup(libGame_gv_players[libGame_gf_DebugHeroSwappedPlayer()].lv_heroUnit);
    CameraUseHeightDisplacement(libGame_gf_DebugHeroSwappedPlayer(), true);
    libGame_gf_CameraUpdateCameraForPlayer(libGame_gf_DebugHeroSwappedPlayer());
    libNtve_gf_SendActorMessageToUnit(libGame_gv_players[libGame_gf_DebugHeroSwappedPlayer()].lv_heroUnit, "SetShowStatusBar");

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:10096

    }

    CameraUseHeightDisplacement(lv_player, true);
    while ((UnitHasBehavior2(lv_unit, "FalstadFlightAscend") == true)) {
        Wait(0.0625, c_timeGame);

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:10100

        Wait(0.0625, c_timeGame);
    }
    CameraUseHeightDisplacement(lv_player, false);
    return true;
}

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:11021

        libGame_gv_players[lv_player].lv_cameraPlayerHasControl = false;
        libGame_gv_players[lv_player].lv_cameraPlayerUnitGroupToFocusOn = libNtve_gf_ConvertUnitToUnitGroup(libGame_gv_players[lv_player].lv_heroUnit);
        CameraUseHeightDisplacement(lv_player, true);
        libGame_gf_CameraUpdateCameraForPlayer(lv_player);
        libGame_gf_PlayerHeroDisplacementCameraUnlock(lv_player, lp_displacingBehavior);

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:11054

    }
    libGame_gv_players[lp_player].lv_cameraPlayerHasControl = true;
    CameraUseHeightDisplacement(lp_player, false);
    libGame_gf_CameraUpdateCameraForPlayer(lp_player);
    return true;

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/HeroesLib.galaxy:4853

        lv_itPlayer = 1;
        for ( ; ( (auto636F45C9_ai >= 0 && lv_itPlayer <= auto636F45C9_ae) || (auto636F45C9_ai < 0 && lv_itPlayer >= auto636F45C9_ae) ) ; lv_itPlayer += auto636F45C9_ai ) {
            CameraUseHeightDisplacement(lv_itPlayer, false);
            libUIUI_gf_UIHeroConsoleShowHideForPlayer(false, lv_itPlayer);
            UISetMode(libCore_gv_playerGroupFromPlayer[lv_itPlayer], c_uiModeFullscreen, c_transitionDurationImmediate);