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.
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! 👌