๐Item Respawn
a.k.a creating links between Timer and Hider
Last updated
a.k.a creating links between Timer and Hider
Last updated
We now have a very simple game. To make it a bit more dynamic, weโll add some more logic to the collectibles to make them appear and disappear until youโve collected enough of them to win. Thereโs more than one way to do this, but we will show you the simplest for now.
To make an item youโve already collected re-appear, select the entity once more, and add the โTimerโ component. Change the time to as many seconds as you like, but we recommend at least 10 or 15, so players arenโt motivated to camp and wait for it to respawn. Now you can create two more links from the entity onto itself - also known as self-links ๐ซ
First, create a new link and select โHidden,โ with the response being โStart timer.โ Next, another link from โTimer endedโ to โShow.โ Because we previously set the collectible to disappear when we collect it, when we collect it now, it will start a countdown until it reappears. This process can loop endlessly until the game ends.
Tip: You can duplicate any entity in the game, so now you donโt have to individually link every single collectible. Simply hold down the Alt key when in Transform mode, select the item and drag to place elsewhere. Keep holding Alt and selecting new duplicates until you have as many as you need.
Weโve just created a super small game that shows you the fundamentals of components and linking. With these basic concepts, you can make a whole lot more โ anything is possible, yeah? Looks like youโre ready to start making your own first game! ๐