# Turn Camera Height Displacement On/Off
Grammar — Turn camera height displacement enable for player player
Flags —Native
|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
int
— Playerbool
<preset::OnOffOption> — On/Off
Returns — void
native void CameraUseHeightDisplacement(
int player,
bool value,
);
# Related
Category: Camera / Camera Tricks
- Lock Camera Input —
void
— CameraLockInput - Set Camera Bounds —
void
— CameraSetBounds - Shake Camera —
void
— CameraShakeStart - Shake Camera Using Preset —
void
— CameraShake - Stop Shaking Camera —
void
— CameraShakeStop - Zoom Camera —
void
— libNtve_gf_SwooshCamera - Follow Unit Group with Camera —
void
— CameraFollowUnitGroup - Unit Group Followed By Camera —
unitgroup
— CameraFollowUnitGroupGet - Force Follow Unit Group with Camera —
void
— CameraForceFollowUnitGroup - Make Camera Look At And Follow Unit —
void
— CameraLookAtUnit - Make Camera Look At And Follow Actor —
void
— CameraLookAtActor - Lock Camera Mouse Relative Mode On/Off —
void
— CameraForceMouseRelative - Turn Camera Mouse Rotation On/Off —
void
— CameraSetMouseRotates - Set Camera Mouse Rotation Speed —
void
— CameraSetMouseRotationSpeed - Turn Camera Height Displacement On/Off —
void
— CameraUseHeightDisplacement - Turn Camera Height Smoothing On/Off —
void
— CameraUseHeightSmoothing - Turn Camera Vertical Field Of View On/Off —
void
— CameraSetVerticalFieldOfView
# Examples
mods/heroesbrawlmods/brawlmapmods/lunarfestival.stormmod — base.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.stormmod — base.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.stormmod — base.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.stormmod — base.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.stormmod — base.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.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:10096
}
CameraUseHeightDisplacement(lv_player, true);
while ((UnitHasBehavior2(lv_unit, "FalstadFlightAscend") == true)) {
Wait(0.0625, c_timeGame);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:10100
Wait(0.0625, c_timeGame);
}
CameraUseHeightDisplacement(lv_player, false);
return true;
}
mods/heroesdata.stormmod — base.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.stormmod — base.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.stormmod — base.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);