Skip to main content

Part 5: Global Stats

Global Stats is a special Stat Source that is automatically put in the Tool Registry with the key of "GlobalStats". All Stats here can be referenced by any Stat Source by using the global: prefix. To create a Global Stats instance, right-click in the Hierarchy panel, and select GDTK > Stats > Global Stats.

"Figure 1"

Adding a Difficulty Setting#

To explore the abilities of Global Stats let's create a new Stat with the Id of "difficulty". We'll use this on our Character Controller in the next step.

"Figure 2"

Consuming the Settings#

Return to your Character Controller's Stat Source and create the Stat below. We'll now see that the five times the amount of the "difficulty" in Global Stats is automatically removed from the maximum of "health".

"Figure 3"