Multiplayer Quiz Game Template

0535

Multiplayer Quiz Game Template

Updated 3/10/2023: - Fixed QuizFeedback events on VR and Mobile players (see more)

Originally published: 2/23/2023

Quiz Game Overview

Use this template to create 3D multiplayer quiz games!
Here are a few general pointers about how it is setup:

  • There is a max limit of 5 players.
  • It can be played by any combination of Desktop PC/Mac users, Chromebook or mobile players, and even VR players with dual controllers like the Quest headsets.
  • To start a quiz match, each player needs to join the multiplayer match, and then choose a PlayerStand to enter.

Editing the Game

Want to remix this template to create your own customizable multiplayer quiz game? Look at each question below to see how to work on a core game mechanic.

How to edit the existing questions and answers?

To change the current questions and answers in the game, you need to find two objects in the scene: the QuestionManager and AnswerManager.

ALT TEXT HERE

Once you have found those objects then you can start changing the quiz's questions and answers.

  1. Change the questions asked to the players by clicking on the QuestionManager.
  2. With the QuestionManager selected, open the Event tab.
  3. Each event asks a different question. Change the text in the events' input fields to ask different questions.

ALT TEXT HERE

  1. Change the answers to the questions (and determine which is the correct answer) by selecting the AnswerManager in the scene.
  2. With the AnswerManager selected, open the Event tab.
  3. Each event presents several different possible answers, as well as defines the correct answer. Change the text in the AnswerBox input field to present different possible answers.
  4. Then at the bottom of each SetAnswer event, make sure to select the correct answer box with "MarkAsCorrectAnswer".

ALT TEXT HERE


How to add new questions and answers?

To add new questions and answers instead of editing the existing ones, you need to copy and paste events on the QuestionManager and AnswerManager objects, and then increase the Maximum round counter so the game doesn't end early!

  1. Select the QuestionManager and open the Event tab.
  2. Scroll down to the bottom of the Event tab and then select the "Copy Event" icon on the last event:

ALT TEXT HERE

  1. Now select the "Paste" icon on the Add new event button:

ALT TEXT HERE

  1. On the new Question event panel, change the question number and the question text:

ALT TEXT HERE

  1. That's it for adding a new quiz question! To add new possible answer to your new question, select the AnswerManager object and open the Event tab again.
  2. Scroll down to the bottom of the event list and copy the final answer event panel:

ALT TEXT HERE

  1. Paste the new event underneath the one you just copied:

ALT TEXT HERE

  1. On the newly pasted Event, change the number to the amount of questions you have and then provide possible answers. Make sure to select the correct AnswerBox at the bottom of the event to identify the right answer!

ALT TEXT HERE

  1. Last step! Find the RoundManager variable in the scene and increase the initial value of the maxRounds component variable to the number of questions you have added!

ALT TEXT HERE


How do PlayerStands work?

There are two core objects that govern how the PlayerStands work.

Trigger
Each PlayerStand has a Trigger which does several things when a Player enters it.

  • Locks the player to that stand: after entering a PlayerStand Trigger, a player is not allowed to move anymore. This is so they can't see other players' answers.

  • Locks itself so it can't be taken by multiple players: ensures that there can only be one player per stand.

  • Sets the label on the Stand UI to the player's name: just like a game show, the stand UI changes to show the player's username when it is entered.

  • Increases the player counter: Adds one to the player counter variable when a player enters the trigger, so the quiz knows exactly how many people are playing.

ALT TEXT HERE

Stand UI
Each PlayerStand has a stand/panel in front which shows and governs some important information.

  • It shows each answer that player has selected for a quiz question.

  • Shows where the selected answer is correct or not.

  • If the answer is correct, then the stand adds the time it took to answer the question to the player's overall score.

  • Clears the player's answer when a new quiz round starts.

ALT TEXT HERE


How do PlayerStands know the answer their player clicked?

The QuizGroup shows the quiz questions and answers, and its sub-group AnswerBoxes contain the events that show which answer was selected, and whether is was correct or not.

ALT TEXT HERE


What do the PhaseManager and RoundManager counters do?

The PhaseManager variable controls each step in a quiz round. It resets itself when a new quiz round is started, so it can be used again for the new round.

Currently there are four phases:

  1. Getting ready: Makes the quizbox come up using it's animation. When that is done the quizbox triggers the next phase
  2. Quiz time! This phase ends when either all players have clicked on an answer or when the round timer is down to 0
  3. Show results: This phase ends when all players have clicked on "Next Round"
  4. Clean up: Makes the quizbox go down again, when that is done the quizbox starts the next round

ALT TEXT HERE

The RoundManager controls how many quiz rounds there are, and when to show the game over text.
ALT TEXT HERE

    Comments

     
    Loading…
    You can also:
    By markusTeam
    I'm the Blocksmith CEO

    More From This Author

    (published on projects)