Hi! This is my first tutorial and I’ll be showing you how to make a system where you need energy(or another item) to move.
- First place a questioner on the map and then place an item granter right beside it.
- Connect the questioner to the item granter with a wire and set it to “Question answer correctly” → “grant item.”
- Click on the item granter and set the item to grant to “Energy”(or your preferred item). Change the amount to grant to the amount of the item you want to give the player after they answer correctly; I’ll set it to 1000.
- You want to let the player see how much energy they have, so we will use a “game overlay” device. Place it behind the questioner and set the overlay type to tracked item. Then change the tracked item to energy(or whatever item you are using) and change the overlay position to top left.
- Next, you want to actually use energy when the player moves. Place a movement meter behind the questioner and set the tracked item to energy(or a different item you are using). After that, set the item drain per tick. I used 17, but you can make it higher and have the player use more energy when moving or vise versa.
- Another thing you want to do is give the player energy at the starting of the game. Place a “starting inventory” device behind the questioner and set the item to grant to energy and the amount to 1000.
NOTE: The energy system already works at this point, and the rest of the tutorial focus on extra features - You want to allow the player to answer questions while they are away from the questioner, which can be accomplished with a “game overlay.” Place it behind the item granter and set the overlay type to button. Then, adjust its position on the screen(I’m putting it in the bottom left) and change the overlay text to “Answer Questions.”
- At this point, clicking the button will not do anything. To make it open the question answering screen, wire it to the questioner and choose “button pressed” → “Open question answering screen.”
- Another feature you can add is a popup when a player runs out of energy. To do this, add a “popup” device on the right of all the other devices and change the header and content to say “out of energy!” Then wire the movement meter to the “popup” and set it to “Player runs out of movement resource” → “open popup.” You can optionally change the popup type to banner, depending on whether you think it looks better than a modal.
- To make the no energy popup a bit better, I added a “answer questions” button to it. You can do this by going to the popup settings, to the “Call to Action” tab and change the call to action label to “Answer Questions.”
- Now the button appears on the popup, but doesn’t do anything. To make it open the question answering screen, wire it to the questioner and choose “Primary call to action clicked” → “Open question answering screen”
- That’s all! You now have a working a energy to move system. The final project should look like this:
EDIT: I couldn’t find any other guides about this topic before posting, so I did figure this all out myself after playing around with gimkit creative for a bit