Creating a kill counter
In this recipe, we will look at one of the many methods to make a quick kill counter for the player based on the HitInfo taken from raycasted weapons (melee, bullets, and so on) and also using the Grunt entity types as the targets.
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 as
KillCounter
.With the Flow Graph open and the new AreaTrigger selected, add in the following nodes:
2x Game:LocalPlayer
Crysis:HitInfo
Math:Counter
HUD:DisplayDebugMessage
Set Crysis:HitInfo Enable to true (1).
You will also need to place down at least one Grunt within the level. Then with the Grunt selected, go back into the AreaTrigger Flow Graph and right-click Add Selected Entity.
Link the Flow...