๐Player Components
Player components allow you to add logic to create some player interactions - and some stakes!
Here, you can configure universal settings for the players of your game, such as the default running speed, levels of gravity, if you can double-jump or not, or things like health or score counters as central mechanics to levels like shooters or treasure hunts.
You can also use Player Components in conjunction with Entity Components to make these universal settings matter. E.g.: if a player enters this area, their health drops; if a player interacts with this object, they gain the ability to run faster or double jump, etc.
Example: Collectibles
Open up the Player Components tab, press + to reveal more options, and select โScore.โ
Select any entity and add the โInteractโ component to it. You can also change the text that appears when the player hovers over the item in-game, so for collectibles itโs best just to put โCollect.โ
Now create a link from the collectible; select โInteractedโ and link to the Player Components icon. Complete the link with โGain Score,โ filtering so only the player that interacted gets points.
If a Player link has already been created, an orange box will appear beneath the icon just like on entities - you can see this is the case below! The same is true for Game Components.
Tip: By default, points go up by 100 whenever you collect something, so make sure your final score is large enough to accommodate this!
To make this game really feel like a competition, in the Score tab of the Player Components menu select โYesโ for โWin by reaching.โ Now itโs a race to see who can collect the most first!
As with Entity Components, some Player Components can function on their own whereas others require added linking to start working.
Last updated