Property Holders
Understand who owns the data for each property you create.
When you create a property, you must define its Holder. The Holder determines the scope of the property—that is, who or what the property's value is attached to. This is a critical concept for creating multiplayer-compatible games.
There are three main types of holders:
1. Global Holder
A property with a Global Holder has one single value for the entire map instance. Every player and every action in the map reads from and writes to this same, shared value.
- Icon: Beacon
- Use Cases:
- Tracking the current round number.
- Storing a global game state, like
isGameStarted. - Counting down a global match timer.
- Storing a reference to a boss entity for everyone to target.
Example:
You create a Global Number property called ZombiesRemaining. When a zombie spawns, you Add 1 to it. When one dies, you Subtract 1. All players see the same count because the property is global.
2. Player Holder
A property with a Player Holder has a separate, unique value for each player in the map. When an action modifies a player-held property, it only affects the target player, not anyone else.
- Icon: Player Head
- Use Cases:
- Tracking an individual player's score, lives, or coins.
- Storing a player's class or selected team.
- Tracking a personal cooldown for an ability.
- Storing a boolean like
hasFoundSecretKeythat is unique to each player.
Example:
You create a Player Number property called Score. When a player completes an objective, an action targets that specific player and adds 1 to their Score. Other players' scores remain unchanged.
3. Team Holder
A property with a Team Holder has a separate value for each team you have created in the Team Module. All members of a team share the same value.
- Icon: Shield
- Use Cases:
- Tracking a team's total score in a deathmatch.
- Storing the number of flags a team has captured.
- Storing a team's spawn location.
- Tracking a team-wide resource count.
Example:
You create a Team Number property called TeamScore. When a player on the "Red Team" scores a point, an action targets the "Red Team" and adds 1 to its TeamScore. All members of the Red Team now share this new score.