The Player HUD
Overview
The player heads up display is made up of a number of UI elements that each present specific information about the player character or their inventory.
The Player Character Watcher
Most of the HUD elements subcsribe to a player character watcher behaviour that is added to an object in their parent hierarchy. This is a behaviour that implements the IPlayerCharacterWatcher interface and tells the HUD elements when the player character changes so that they can attach to the relevant property or system attached to the character. If a behaviour that implements this interface is not found, then the HUD elements will log an error to the console on start. The NeoFPS samples use the SoloPlayerCharacterEventWatcher behaviour, though you are free to implement your own if required.
HUD Layout
The demo HUD makes use of Unity's UI auto layout components to properly order items. This means that when a player character is spawned that does not have a certain feature attached or enabled, then the relevant HUD item will be hidden, and the other HUD elements in its group will be positioned to fill the gap.
HUD Hider
The HudHider is used to hide the HUD elements when the player is not looking through a first person camera. This can be used for things like cutscenes.
Included HUD elements
The following HUD elements are included with NeoFPS for direct use or for reference when designing your own player HUD.
Health Counter

The health counter shows how much health your character currently has. For more information see HudHealthCounter.
Shield Meter

The shield meter shows the status of the player character's energy shields. These can be split into multiple shield steps which recharge unless broken. For more information see HudShieldMeter.
Damage Markers

The damage markers highlight which direction damage comes from. The relevant edge of the screen is highlighted and then fades out over time. For more information see HudDamageMarkers.
Death Popup

The death popup appears when the player character is killed and before they respawn. For more information see HudDeathPopup.
Ammo Counter

The ammo counter shows the current and available ammo along with the ammo type and weapon mode. For more information see HudAmmoCounter.
Firearm Mode

The firearm mode readout will appear when the player selects a firearm that has multiple modes. It displays the current mode. For more information see HudAmmoCounter.
Crosshair

The crosshair is used for aiming and expands and contracts based on the current accuracy of the weapon. Multiple crosshairs can be used and referenced by ID. For more information see HudCrosshair.
You can also use the advanced crosshair system which has a more extensible system for drawing individual crosshairs, and adds hit and critical hit markers. For more information see HudAdvancedCrosshair.
Scopes

The scope is an image overlay that is used for certain weapons. Multiple scope images can be used and are referenced by ID. For more information see HudScope.
Interaction Tooltip

The interaction tooltip displays the name of the interactive object you are currently aiming at, along with the action performed when you interact with it. For more information see HudInteractionTooltip.
Progress Bar

The progress bar is used to show the interaction progress for items that require you to hold down the interact control. For more information see HudProgressBar.
Stamina Bar

The stamina bar shows how much health your character currently has. For more information see HudStaminaBar.
Inventory - Standard

The standard inventory is the kind of inventory you would see in a classic PC FPS. Each weapon has a set slot in a sequence that matches the number keys. This HUD inventory is also used for the swappable inventory. For more information see HudInventoryStandardPC and HudInventoryItemStandard.
Inventory - Stacked

The stacked inventory groups items together into stacks of a similar type. This is the inventory used in FPS games such as Half-Life. For more information see HudInventoryStackedPC, HudInventoryItemStacked and HudInventoryStackedSlot.
Meters and Counters

A number of different HUD meters and counnters are provided to track various properties. These include:
| Behaviour | Description |
|---|---|
| HudInventoryItemCounter | Shows the quantity of a specific item in the player character's inventory. |
| HudInventoryItemMeter | Shows the quantity vs max quantity of a specific item in the player character's inventory. |
| HudMotionGraphParameterMeter | Shows the value in the relevant motion graph parameter on the character as a meter based on a set range. |
| HudMotionGraphParameterReadout | Shows the value in the relevant motion graph parameter on the character. |
| HudOxygenMeter | Shows the amount of oxygen remaining while swimming. |
| HudSlowMoCharge | Shows the charge of the slow-mo system. Sometimes called focus or adrenaline. |
| HudStaminaBar | Shows the player character's stamina / fatigue levels. |
Target Lock

The target lock HUD shows icons over objects in the world that are locked onto. Locks can be partial (a second icon overlays and shows the lock progress) and full (only a location marker is shown). For more information see HudTargetLockMarkers and HudTargetLock
Touch controls

A number of touch controls are available for touchscreen input. For more information see [Touchscreen Input][input-touchscreen.md].