Displaying the player's health through a Flow Graph
Unfortunately, with the CryENGINE 3 SDK there is no current HUD element in place that displays the player's health out of the box. In this recipe, however, we will look at adding in a health display through the Flow Graph that will show the player's health in a numerical fashion.
Getting ready
Open My_Level.cry
within the Sandbox
How to do it...
Begin by placing an AreaTrigger entity onto the map to use as the container for the Flow Graph.
In the RollupBar, click on the Entities button.
Under the Triggers section, select AreaTrigger.
Right-click the newly placed AreaTrigger and create a new Flow Graph. Name the Flow Graph
PlayerHealth
.With the Flow Graph open and the new AreaTrigger selected, add in the following nodes:
Game:LocalPlayer
Time:Timer
Game:ActorGetHealth
HUD:DisplayDebugMessage
Set Time:Timer period to 0.05.
Note
You may also need to adjust the posX or posY on the HUD:DisplayDebugMessage if you have the Kill Counter as well.
Link...