๐Ÿ”‚Item Respawn

a.k.a creating links between Timer and Hider

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.

And thatโ€™s it!

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! ๐Ÿ‘Œ

If you need more help, or want to boast about your amazing building skills, hop on into our Discord to join all the fun. Weโ€™ll see you there ๐Ÿคž

Last updated