How to make a Quiz Game in Unity (E03 CORE GAME) - Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ธ.ค. 2024

ความคิดเห็น • 261

  • @alijh8
    @alijh8 7 ปีที่แล้ว +2

    I love this guy. He teachs like pro teachers

  • @kennyPAGC
    @kennyPAGC 8 ปีที่แล้ว

    At 7:38 although I agree that probably makes more sense to remove the question once it's already answered, if we get picky about efficiency, it should be noted that removing an element from a list relative to an index is O(1) while removing an object relative to its reference is O(n) because it needs to find where it is.
    That is if C# List implementation is an array-type collection instead of a linked collection, which I assume it is.
    This difference literally makes no difference in such a small program/game but I think it's useful you let you guys know.

  • @AntPontes
    @AntPontes 8 ปีที่แล้ว +1

    Very good work indeed! This True-False quiz is really interesting. I would love to see in near future another quiz with generated questions but instead of two buttons (true and false), four buttons with possible answers, A B C D and only one right answer. Something like “Who wants to be a millionaire” but kept simple only with the question label and the four buttons with possible answers, and of course the background canvas.
    Thank you for sharing this knowledge.

  • @pascotech7802
    @pascotech7802 7 ปีที่แล้ว

    thank you very much this is the first of tutorials that i have actually followed with minimal errors on my end.. thanks alot

  • @rielmaelapig
    @rielmaelapig 7 ปีที่แล้ว

    your face in the bottom right screen motivates me

  • @alexrobert4614
    @alexrobert4614 8 ปีที่แล้ว +14

    So how would we do exactly with multiple choices? and what if I don't want the question to be a string, but an image?

    • @natalieweishuhn521
      @natalieweishuhn521 5 ปีที่แล้ว

      @Liam Rahum How would you do it making it multiple choice though?

    • @johnritchdelacruz471
      @johnritchdelacruz471 4 ปีที่แล้ว

      i make 4 boolean . then name it a,b,c,d example if(currentQuestion.A) then its correct else false

    • @pakoulefilou7295
      @pakoulefilou7295 4 ปีที่แล้ว

      @Liam Rahum can you write how to do? Please ❤

    • @pakoulefilou7295
      @pakoulefilou7295 4 ปีที่แล้ว

      Ok just same thing but public sprite image_question do the job

    • @MrJustJessop
      @MrJustJessop 4 ปีที่แล้ว +1

      @@pakoulefilou7295 I think what he means here is have four separate booleans
      public bool isA;
      public bool isB;
      public bool isC;
      Then you can just use roughly the same test code to test which boolean is true or not

  • @behumble5672
    @behumble5672 8 ปีที่แล้ว +1

    Thanks for this video. Next time I hope you can upload a video that teaches "how to make a quiz game with 2D animations", with 2D or 3D RPG like animations. For example, if the user picks a correct answer, a character will dodge an attack, if the user picks a wrong answer, a character will be hitted by an enemy, and his hp will be lessened.

  • @Rok1js
    @Rok1js 7 ปีที่แล้ว +1

    5:25 my console does not show up messages correct or false pls help asap

  • @insightvideos8
    @insightvideos8 6 ปีที่แล้ว

    better than my 3years study. Thanks! :D

  • @syarifnm3047
    @syarifnm3047 8 ปีที่แล้ว +9

    i love this series, hope u can make multiplayer quiz game

  • @sleggilife
    @sleggilife 8 ปีที่แล้ว

    Great tutorial!!!!! Very clear. I hope you will make a part 4!!!!

  • @d_ne
    @d_ne 6 ปีที่แล้ว +3

    am I the only person that cant put an image on brackeys forum?! And btw I cant do anything after 18:33

    • @diogopinheiro5337
      @diogopinheiro5337 5 ปีที่แล้ว

      Me too

    • @diogopinheiro5337
      @diogopinheiro5337 5 ปีที่แล้ว

      I know what you have to do, i figured out

    • @cyriliss
      @cyriliss 4 ปีที่แล้ว

      What do you have to do to fix it?

    • @a.manraizada
      @a.manraizada 4 ปีที่แล้ว

      @@diogopinheiro5337 Pleasae Help man!!

  • @furkan8436
    @furkan8436 7 ปีที่แล้ว

    Thank you very much for your presence!!!!

  • @simiondragos4558
    @simiondragos4558 8 ปีที่แล้ว +2

    I try to make a quiz game but i'm stuck on animation , i make the animation clip for canvas , then i need to make for the True or False button the animation but insted of make an animation clip unity demand to create animated clip and then when i acces the animation folder i have 3 controllers . One for Canvas , one for false buttn and one for true button .. i want to make the animation like brackeys but i can.. maybe i need the pro versin of unity .. please answer , i'm stuck !!

  • @legacykira6460
    @legacykira6460 7 ปีที่แล้ว

    hi yellow hair guy good job man carry on im folowing this serie with you ^^

  • @thegr8ahmed385
    @thegr8ahmed385 8 ปีที่แล้ว +6

    How do we add a score if the scene starts every time

    • @Ambo100
      @Ambo100 8 ปีที่แล้ว +5

      Instead of restarting the scene use the TransitionToNextQuestion() method to run SetCurrentQuestion () and reset the animation states for both the true and false animations. You can reset the animations by creating a new trigger called 'Reset', make sure this is triggered under the SetCurrentQuestion() method and that you have set up transitions from both True and False animations to the Exit state. Disable Exit Time for both transitions and include the trigger 'Reset' in both transitions.
      Once you run out of questions instead of looping you will now get the error ArgumentOutOfRangeException: Argument is out of range. You need to add an IF statement to check if there are 0 questions remaning and if so display a score screen, reset the game or do whatever you like.

    • @atusgonzales6493
      @atusgonzales6493 7 ปีที่แล้ว

      How to do this? Pls help :(

  • @shaheen3953
    @shaheen3953 8 ปีที่แล้ว +2

    2:39 .... stuck here the text doesn't show up in the question panel here is my code; Any help is appreciated
    using UnityEngine;
    using UnityEngine.UI;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;public class GameManager : MonoBehaviour { public Question[] questions;
    private static List unansweredQuestions; private Question currentQuestion; [SerializeField]
    private Text factText; void Start ()
    {
    if (unansweredQuestions == null || unansweredQuestions.Count == 0)
    {
    unansweredQuestions = questions.ToList();
    }
    SetCurrentQuestion(); } void SetCurrentQuestion ()
    {
    int randomQuestionIndex = Random.Range (0, unansweredQuestions.Count);
    currentQuestion = unansweredQuestions [randomQuestionIndex]; factText.text = currentQuestion.fact; unansweredQuestions.RemoveAt (randomQuestionIndex);
    }
    }

    • @mbsnke2349
      @mbsnke2349 8 ปีที่แล้ว +1

      I have the same problem please help

    • @shaheen3953
      @shaheen3953 8 ปีที่แล้ว +2

      i found out, the text gets deleted for some reason, reinsert new text from material UI

    • @shdbusbwusbd
      @shdbusbwusbd 7 ปีที่แล้ว +1

      Seyed Shaheen Yes it works reput the text thanks bro

    • @shaheen3953
      @shaheen3953 7 ปีที่แล้ว +1

      Andrea Olivier No Problem

    • @shdbusbwusbd
      @shdbusbwusbd 7 ปีที่แล้ว +1

      Seyed Shaheen its a temporary

  • @waylonhudspeth244
    @waylonhudspeth244 8 ปีที่แล้ว

    at 5:04 I can't select "UserselectTrue". Any ideas?

    • @mikkelkirkeby9946
      @mikkelkirkeby9946 8 ปีที่แล้ว

      Waylon Hudspeth you need to type "UserSelectTrue" i think

  • @rea_kuma
    @rea_kuma 6 ปีที่แล้ว +1

    How can I make it random without repeating? And after finishing all items, how can I go to the result canvas?

    • @Sonsho
      @Sonsho 5 ปีที่แล้ว

      Have you figured it out?

  • @user-wj3zg3vm4v
    @user-wj3zg3vm4v 6 ปีที่แล้ว

    thanks. hope u continue making tutorial for us about unity :D

  • @joseephcedeno4556
    @joseephcedeno4556 6 ปีที่แล้ว

    this guy is just plain awesome tho

  • @myboybovice
    @myboybovice 8 ปีที่แล้ว +1

    How could you make it so that after you answer the question, it moves on to another set of questions? So they could get progressively harder but also still be random.

  • @colecabral1948
    @colecabral1948 8 ปีที่แล้ว

    Hey Brackeys Just want to say I love your videos!!! They help me so much!!! But I was just thinking that you should create a Vlog channel to show what you do on a daily basis. I would really like to see this.

    • @roko567
      @roko567 8 ปีที่แล้ว +1

      blah, who cares honestly

  • @wcamicase_gaming
    @wcamicase_gaming 8 ปีที่แล้ว

    I'm making a game that uses quizes to decide if the player or enemy attack.
    My problem is that when reloading the scene that also causes the HP to go back to max, if I use a DontDestroyOnLoad it won't ever let me do damage again.
    I'd like to ask which other way you where going to use to get a new question instead of loading the whole scene again.
    Thank you :)

    • @Ambo100
      @Ambo100 8 ปีที่แล้ว

      th-cam.com/video/zLnnpUsxu0U/w-d-xo.html&lc=z12ng5wbnsnbvzefy23xwnl5cxbgjdosn.1468245861043523

  • @kennyPAGC
    @kennyPAGC 8 ปีที่แล้ว

    is there any way to change visual studio tips so that the first suggested method/attribute is selected instead of having to press down arrow key + enter which is pretty annoying?

  • @indrapatrick2349
    @indrapatrick2349 8 ปีที่แล้ว +1

    Can someone help me ?
    I am using Monodevelop for coding, When I type using UnityEngine.SceneManagement;
    after I compile, it shows that The type or namespace name 'SceneManagement' does not exist in the namespace 'UnityEngine'.
    Why is that ? And how to fix it ?

    • @wasituzayer9728
      @wasituzayer9728 6 ปีที่แล้ว

      I too am Facing the same problem...

    • @SeventeenOof
      @SeventeenOof 5 ปีที่แล้ว

      ez just download visual stuidos it doesnt take up too much storage and uninstall monodevelop

  • @drowsy5384
    @drowsy5384 7 ปีที่แล้ว +3

    Brackeys 10:24 I believe that problem could easily be solved by not adding | | currentQuestion.Count == 0 in start method.

    • @lakshmanank7256
      @lakshmanank7256 7 ปีที่แล้ว +1

      That apparently has fixed the problem. After it shows all the questions, I am getting a "ArgumentOutOfRangeException: Argument is out of range.
      Parameter name: index" error. Will try not to load a new question when all are answered. (Haven't watched the video fully; not sure if there is a way not to try loading a new one). Thanks :)

    • @ajskjzkvb
      @ajskjzkvb 6 ปีที่แล้ว +1

      did you figure out how to not load another question?

    • @FernandoAMVs
      @FernandoAMVs 5 ปีที่แล้ว

      @@ajskjzkvb
      I have this problem of Argument is out of range

  • @peter-kun4506
    @peter-kun4506 5 ปีที่แล้ว +1

    Hello thanks for the Tutorial! btw how can I end the Question Loop?

  • @colinlafond
    @colinlafond 8 ปีที่แล้ว

    Hey Brackeys. I am having an error that whenever i click on the true or false button the animation slides a little bit but not enough to read the correct or wrong writing be cause its slides for a second than changed to the next question. If you don't understand me I can send you a video of what I mean. Hope you can help...

  • @sacred2755
    @sacred2755 8 ปีที่แล้ว +1

    Thank you very much, Brackeys

    • @Brackeys
      @Brackeys  8 ปีที่แล้ว +1

      +Sathwiq Sivadas You're welcome :D

    • @plank8989
      @plank8989 8 ปีที่แล้ว

      +Brackeys Hey Brackeys i wanted to ask you if you can make a top down shooter tutorial, I have a couple of ideas for games like that, but I am finding it really difficult to make one. Sorry if you have already done a tutorial like that.

    • @royce623
      @royce623 7 ปีที่แล้ว

      Brackeys hlo one small doubt I ask menyukai times in Quiz game in Animation u use key frame it means wt and how to select plzzz ans me plzzzz

  • @eljoons
    @eljoons 8 ปีที่แล้ว

    Very well done congrats, and thank you so much for the video !! :)

  • @kwstis6347
    @kwstis6347 4 ปีที่แล้ว

    I get the error that 'Question' does not contain a definition for 'fact' and no accessible extension method 'fact' accepting a first argument of type 'Question' could be found (are you missing a using directive or an assembly reference?)
    Can someone help me please?

  • @acidfz1031
    @acidfz1031 4 ปีที่แล้ว

    trueAnswer.text , falseAnswer.text
    Can this be image instead of text
    And not under the buttons but above same area where the question text is?
    Can it still be
    if ( currentQuestion.isTrue)
    Someimage.?? = "CORRECT";
    would it work?

  • @SeventeenOof
    @SeventeenOof 5 ปีที่แล้ว

    If i were to not do the animation part and instead make text appear on the screen telling me what is correct and incorrect what would i code?

  • @dennissejoydegrano8910
    @dennissejoydegrano8910 7 ปีที่แล้ว

    what will be the if statement code is I don't want the answered question to be repeated? what would be the alternative for this??------
    SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);

  • @SeventeenOof
    @SeventeenOof 5 ปีที่แล้ว +1

    can anybody help me? I am having trouble with animation because whenever i animate, it turns into two different animation scripts.If anybody has a solution please message me. I am using unity 2018.2.13f1 personal.

    • @TMBlackmilk
      @TMBlackmilk 5 ปีที่แล้ว

      did you find a fix? iam having the same issue

    • @SeventeenOof
      @SeventeenOof 5 ปีที่แล้ว +1

      @@TMBlackmilk no, I've accepted it as part of life and I am trying to find a way around it

  • @aldrine.tolentino
    @aldrine.tolentino 7 ปีที่แล้ว

    I need a help here. so I made a 20 set of questions and when the game starts, the questions are called randomly, but I need to end the game after displaying 10 questions, how can I make it happen? I tried to put an if statement in the transitiontonextquestion method and also tried to put it in the start method but the game ends when it displays the 10th question in the list even if it was the 1st question to be displayed, it ends the game automatically.

  • @hoshizora990
    @hoshizora990 6 ปีที่แล้ว

    Hi, it's really helpfull, but i'm having a problem. i'm trying to make it transition to the next question without load the scene, i'm trying to call the SetCurrentQuestion() in the IEnumerator, it works nicely but when i reach the last question i got an error says "Argument is out of range". is there a way to go to the next question without loading the scene? any help would be appreciated.
    Please Help

    • @FernandoAMVs
      @FernandoAMVs 5 ปีที่แล้ว

      I have this problem: Index was out of range
      Do you remember if you did it and how?

  • @ugurokus
    @ugurokus 4 ปีที่แล้ว

    Brilliant tutorials. However, unity threw "identifier expected" error for unity.ui line. Seems I'm not alone on this one. I've seen dozens of forum pages without any solutions. My version is 2018.4.17 personal. Any thoughts?

  • @ylhameresov9492
    @ylhameresov9492 8 ปีที่แล้ว +1

    Waiting 4 this video. Thanks!

  • @robertomorales8751
    @robertomorales8751 8 ปีที่แล้ว

    hey man this may be a dumb question but I was making a game and I wanted to set an object as a child of the character is there a way that can do that with java script??

  • @jarendaser2074
    @jarendaser2074 8 ปีที่แล้ว

    how about if its not a multiple choice game whrein it will only ask quistion and its up to you to figure it out bfore advancing to the next level can you please hlp me wth tht

  • @scottsmith1300
    @scottsmith1300 8 ปีที่แล้ว +1

    Very cleaver, thank you very much! a bit of criticism, your direction on animations was very weak! the animations portion and relation between animation & animator is very important to me. Thanks again, I'm a loyal subscriber.

    • @Brackeys
      @Brackeys  8 ปีที่แล้ว +1

      +Scott Smith Thanks for expressing your opinion, I always appreciate constructive criticism :)

    • @royce623
      @royce623 7 ปีที่แล้ว

      Brackeys almost over this quiz game but one small doubt in Animation how to select star symbol , mouse drag to two stars it will select after what do plzz ans me I am waiting for u r ans

  • @AncientWorld1
    @AncientWorld1 6 ปีที่แล้ว

    very cool tutorial, thank you very much

  • @alversonsabuero770
    @alversonsabuero770 4 ปีที่แล้ว

    TransitionToNextQuestion(); on line 36 is at error what would i do to fix this? thank you

  • @royce623
    @royce623 7 ปีที่แล้ว +1

    in this Quiz game one doubt on series 3 in 20.13 minutes , Animation how to select diamond shaped symbol plzz ans me

  • @shpenky
    @shpenky 8 ปีที่แล้ว

    What would I have to do if I would want it to go back to a menu screen after it's went over all the questions?

    • @imranyuratsi
      @imranyuratsi 7 ปีที่แล้ว

      Make a button to come back to the menu that appears when you've answered all the questions, u can search on google :)

    • @shpenky
      @shpenky 7 ปีที่แล้ว

      Yeah I already figured it out, made it so that it only fills the list at the start of the scene, then doesn't reload the scene after every answer, and then when the list is empty again it goes to a score screen scene. But thanks for the reply anyways :)

  • @jafalm9612
    @jafalm9612 6 ปีที่แล้ว +1

    How do i do the multiple question? thanks

    • @meldran1553
      @meldran1553 6 ปีที่แล้ว

      I am also waiting for an answer
      Please Help

  • @hyperfixatedd
    @hyperfixatedd 3 ปีที่แล้ว

    thank you so much man. just thank you

  • @ProjektDesigns
    @ProjektDesigns 8 ปีที่แล้ว

    How Do You Rename The Canvas Animation?I Never Figured That Out.I'm New To Unity

  • @shiawyenlai530
    @shiawyenlai530 6 ปีที่แล้ว +1

    Faced problem in the animation part, anyone can help me? I really need your help

    • @SeventeenOof
      @SeventeenOof 5 ปีที่แล้ว

      were you able to fix it yet? I also have the same problem

  • @diher57
    @diher57 8 ปีที่แล้ว

    Thank you for your tutorial ;)
    I have not found a correct solution for my question,.
    I would like to use a TXT file as words( Facts) source from where the values/words would be read.
    Instead Lists,
    Because I would like to create a big source ,from where the facts/questions would come and a TXT file is more editable and more easily extendable.
    How could I solve this, you have any tips ? Or is it possible with unity ?
    Thank you so much , sorry for my confusing sentences

  • @Hacsev
    @Hacsev 8 ปีที่แล้ว

    Great video! I have a question regarding importing, is it necessary to include UnityEngine.UI? Doesn't importing the library UnityEngine include that already?

    • @pacukluka
      @pacukluka 8 ปีที่แล้ว

      not in unity 5, you also need unityengine.scene managment now

    • @pacukluka
      @pacukluka 8 ปีที่แล้ว

      +pacukluka if you want changing scenes that is

  • @BlondLion
    @BlondLion 8 ปีที่แล้ว

    Guys, if you enjoy the videos, click "I Like", so he will have more visibility!

  • @dahidd
    @dahidd 8 ปีที่แล้ว

    Great tutorial Brackey, I will use this to create a quiz game. Have you made other tutorials for score counters?

    • @dmitrij34
      @dmitrij34 8 ปีที่แล้ว

      +Dahid Making a score counter is easy. You can do it like so:
      [SerializeField]
      private Text scroreText;
      private int userScore;
      create a label and assign it in the inspector to the scoreText slot
      Each time user answers a question increment/ decrement userScore, then set your scoreText.Text = userScore.ToString();
      hope it helps =)

    • @dahidd
      @dahidd 8 ปีที่แล้ว +1

      +Дмитрий Ковалёв Thanks i'll save this to a text file i have to finish my project by next week :D

    • @dmitrij34
      @dmitrij34 8 ปีที่แล้ว

      Actually, for the simplicity it's better to declare
      counter variable like so:
      private static int userScore;
      this way it will not reset during scene changes.

    • @dahidd
      @dahidd 8 ปีที่แล้ว

      Thanks again!

    • @dahidd
      @dahidd 8 ปีที่แล้ว

      I tried your solution but i can't find where to place the increment and scoreText.Text = userScore.ToString();
      I need to determine whether or not the user answered the question correctly or not and put it there, i just don't know where that is in the code :/

  • @IxxaGaming
    @IxxaGaming 2 ปีที่แล้ว

    hi mr,your tutorial is very good i love it, but I want ask a question, is it possibble to make a quiz in unity with database?

  • @officialRandall
    @officialRandall 8 ปีที่แล้ว +1

    Could you make a series about the game AI, navmesh and for instance a dialogue system? After this Quiz Game tutorials maybe you can show us a simple RPG game. Im very interested in these features .

  • @DRGamerPRO
    @DRGamerPRO 8 ปีที่แล้ว

    Hey Brackeys great tutorial! Are you able to make a series on a Horror game or Simulator game?

  • @hasiiieo
    @hasiiieo 6 ปีที่แล้ว

    How do use this type of script that will enable to still continue the series of question without transtioning the same scene

  • @beatrizandrade5184
    @beatrizandrade5184 8 ปีที่แล้ว

    Hi can you help me for my project? It is the same type, but I need to put a gif instead of a question. Please! Help Me

  • @samrad2
    @samrad2 8 ปีที่แล้ว

    Awesome series!

  • @vortexthesorcerer1563
    @vortexthesorcerer1563 6 ปีที่แล้ว

    I get to the 22nd min and my buttons don't move. Could you help me with that?

    • @shiawyenlai530
      @shiawyenlai530 6 ปีที่แล้ว

      Hello, I faced that problem too, haved you solved it?

  • @mrqwerty005
    @mrqwerty005 6 ปีที่แล้ว

    I have changed the icon on buttons.My quiz is actually visual.I can't figure out how to change the icons on buttons after the questions are changed please help me

  • @ashurashur257
    @ashurashur257 8 ปีที่แล้ว

    Thank You, I love your channel !
    But the questions don't appear when i play the game,
    i dont know if its a Script problem or something else.
    Please help !

  • @AntPontes
    @AntPontes 8 ปีที่แล้ว

    Does this quiz game work with Unity Personal Edition?

  • @Paw.Paradise
    @Paw.Paradise 8 ปีที่แล้ว +4

    When the scene is reloaded, the gamemanager doesn't get active.
    what i am doing wrong?

    • @RobotAlienGaming
      @RobotAlienGaming 7 ปีที่แล้ว +1

      You need to save your code in Visual Studio before you test your code in Unity

  • @hasiiieo
    @hasiiieo 6 ปีที่แล้ว

    i got a question, how do you condition if there are no more question available?

  • @PapiFluffs
    @PapiFluffs 4 ปีที่แล้ว

    If the game is multiple choice how would I get the answers to show up with the randomized question?

  • @wasituzayer9728
    @wasituzayer9728 6 ปีที่แล้ว

    I am in MonoDevelop & when I type using UnityEngine.SceneManagement; it doesn't work.. Why isn't Scene Management coming, can anyone help. Its inportant, please.....

  • @rrolfrexhaj6800
    @rrolfrexhaj6800 8 ปีที่แล้ว

    Hey Great Tutorial @Brackeys :) I have One question.
    Iam making my own game, but i want to do without reloading the scene, just moving from one question to the other.
    Any Help?
    Thnx in advance

    • @varunsahni793
      @varunsahni793 2 ปีที่แล้ว

      using System.Collections;
      using System.Collections.Generic;
      using UnityEngine;
      using System.Linq;
      using UnityEngine.UI;
      public class GameManager : MonoBehaviour
      {
      public Question[] questions;
      private static List unansweredQuestions;
      private Question currentQuestion;
      public static int score;
      [SerializeField]
      private Text factText;
      [SerializeField]
      private float timeBetweenQuestions = 1f;
      [SerializeField]
      private Text trueAnswerText;
      [SerializeField]
      private Text falseAnswerText;
      [SerializeField]
      private Animator animator;
      void Start()
      {
      if (unansweredQuestions == null || unansweredQuestions.Count == 0)
      {
      unansweredQuestions = questions.ToList();

      }
      SetCurrentQuestion();
      }

      void SetCurrentQuestion(){
      int randomQuestionIndex = Random.Range(0, unansweredQuestions.Count);
      currentQuestion = unansweredQuestions[randomQuestionIndex];
      factText.text = currentQuestion.fact;
      // unansweredQuestions.RemoveAt(randomQuestionIndex);
      if (currentQuestion.isTrue)
      {
      trueAnswerText.text = "CORRECT";
      falseAnswerText.text = "WRONG";
      }
      else
      {
      trueAnswerText.text = "WRONG";
      falseAnswerText.text = "CORRECT";
      }
      }
      public void UserSelectTrue ()
      {
      animator.SetTrigger("True");
      if (currentQuestion.isTrue)
      {
      score++;
      Debug.Log(score);
      }
      else
      {
      score--;
      Debug.Log(score);
      }
      StartCoroutine(WaitForNextQuestion());
      }
      public void UserSelectFalse()
      {
      animator.SetTrigger("False");
      if (!currentQuestion.isTrue)
      {
      score++;
      Debug.Log(score);
      }
      else
      {
      score--;
      Debug.Log(score);
      }
      StartCoroutine(WaitForNextQuestion());
      }
      IEnumerator WaitForNextQuestion()
      {
      unansweredQuestions.Remove(currentQuestion);
      yield return new WaitForSeconds(timeBetweenQuestions);
      animator.SetTrigger("goBack");
      if(unansweredQuestions.Count == 0)
      {
      unansweredQuestions = questions.ToList();
      }
      yield return new WaitForSeconds(timeBetweenQuestions);
      SetCurrentQuestion();
      }
      }

  • @kalvinvalentino5402
    @kalvinvalentino5402 3 ปีที่แล้ว

    So.. i got this problem "ArgumentException: method arguments are incompatible"
    can someone help me fix it?

  • @SeventeenOof
    @SeventeenOof 5 ปีที่แล้ว +3

    Just opened unity, have 1 week left until project is due, everything is deleted, very, very demotivating

  • @simongriscti
    @simongriscti 8 ปีที่แล้ว

    when I play my game ,when I press the false button it will not go to the next question! But when I press the true button it will go. Like I have to press true not false.
    Please Help me

  • @ioannisvasileiou9264
    @ioannisvasileiou9264 7 ปีที่แล้ว

    Really Great Job !!
    Would y create a multiplayer quiz game /??

  • @gunshotgaming1853
    @gunshotgaming1853 6 ปีที่แล้ว

    Can you make question cards the code them like a normal question

  • @realgugabyte
    @realgugabyte 8 ปีที่แล้ว

    does microsoft visual studio work for html?

  • @postivision
    @postivision 8 ปีที่แล้ว

    Are there going to be more videos of this lesson

  • @robertpaul9938
    @robertpaul9938 8 ปีที่แล้ว

    Sir how about the record of correct and wrong? to modify how many correct and wrong

  • @abdullatif7411
    @abdullatif7411 3 ปีที่แล้ว

    Does anyone know on how to add scores for the True/False game ?

  • @NoelJasik
    @NoelJasik 6 ปีที่แล้ว +1

    Great Guides

  • @binarydesign2725
    @binarydesign2725 8 ปีที่แล้ว

    hello brackeys..i have some problem here...the placeholder did not swap with the question...thank you
    #sorryForBrokenLanguage

  • @shubhamkumbhar3791
    @shubhamkumbhar3791 7 ปีที่แล้ว

    My animations are not working even though I had done everything the same there are no errors but no animations too... I am trying still though to make it happen

    • @Daniel-do2mh
      @Daniel-do2mh 6 ปีที่แล้ว

      Have you solved it? I have the same problem too.

    • @shiawyenlai530
      @shiawyenlai530 6 ปีที่แล้ว

      @@Daniel-do2mh Hello, I faced the same problem in animation part, any solution?

    • @Daniel-do2mh
      @Daniel-do2mh 6 ปีที่แล้ว

      I kinda solved it. I had to start a new project.

    • @shiawyenlai530
      @shiawyenlai530 6 ปีที่แล้ว

      @@Daniel-do2mh can I know how you solved it?

    • @Daniel-do2mh
      @Daniel-do2mh 6 ปีที่แล้ว

      Well. I saved all the stuff (such as the code, questions, sprites and so on) and started a new one. I don't know what's the actual problem. But the second time it worked.

  • @noelrequilman35
    @noelrequilman35 8 ปีที่แล้ว

    hello sir. how to make the buttons 4? or choice a,b,c,d?? badly needed sir. thank you! your great!! ASAP Please :'(

  • @hajishahji9026
    @hajishahji9026 8 ปีที่แล้ว

    can you please tell me when you will out final video of the series........................ fast we all are waiting for your video

  • @cosminkrajela4549
    @cosminkrajela4549 8 ปีที่แล้ว

    You are awsome from italy :)

    • @FlyingUnosaur
      @FlyingUnosaur 8 ปีที่แล้ว +3

      +Cosmim Krajela but he's awesome everywhere

  • @intellectualfreedom8790
    @intellectualfreedom8790 7 ปีที่แล้ว

    If I want the questions to NOT be random, how do I do that?

  • @om1txd34
    @om1txd34 8 ปีที่แล้ว

    My mouse cursor is disappearing everytime i click the play button. Can someone help me please?

  • @nugiemurpy
    @nugiemurpy 4 ปีที่แล้ว

    how to make end quiz for this? the questions always looping

    • @pathfinder6121
      @pathfinder6121 4 ปีที่แล้ว +1

      //Add this 2 line in ienumerator after calling scenemanager
      if(unansweredquestions.Count == 0)
      {SceneManager.LoadScene("Congratulations");}

    • @nugiemurpy
      @nugiemurpy 4 ปีที่แล้ว +1

      @@pathfinder6121 ok thx.. now i understand the code

  • @srijanreddy9715
    @srijanreddy9715 6 ปีที่แล้ว

    is it ok if we remove noanswer animation

  • @captainc00ltwo
    @captainc00ltwo 7 ปีที่แล้ว

    I get these 2 errors in my script and don't know how to fix them.
    NullReferenceException: Object reference not set to an instance of an object
    quiz.UserSelectFalse () (at Assets/Scripts/quiz.cs:74)
    NullReferenceException: Object reference not set to an instance of an object
    quiz.UserSelectFalse () (at Assets/Scripts/quiz.cs:89)
    using UnityEngine;
    using UnityEngine.UI;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;
    using UnityEngine.SceneManagement;
    public class quiz : MonoBehaviour
    {
    public Question[] questions;
    private static List unansweredQuestions;
    private Question currentQuestion;
    [SerializeField]
    private Text FactText;
    [SerializeField]
    private Text TrueAnswerText;
    [SerializeField]
    private Text FalseAnswerText;
    [SerializeField]
    private float TimeBetweenQuestions = 1f;
    [SerializeField]
    private static int scorePoints;
    [SerializeField]
    private Text scoreText;
    void start()
    {
    if (unansweredQuestions == null || unansweredQuestions.Count == 0)
    {
    unansweredQuestions = questions.ToList();
    }
    GetRandomQuestion();
    UpdateScore();
    }
    void GetRandomQuestion ()
    {
    int RandomQuestionIndex = Random.Range(0, unansweredQuestions.Count);
    currentQuestion = unansweredQuestions[RandomQuestionIndex];
    FactText.GetComponent().text = currentQuestion.fact;
    if (currentQuestion.istrue)
    {
    TrueAnswerText.text = "CORRECT";
    FalseAnswerText.text = "WRONG";
    }else
    {
    TrueAnswerText.text = "WRONG";
    FalseAnswerText.text = "CORRECT";
    }
    }
    IEnumerator TransitionToNextQuestion ()
    {
    unansweredQuestions.Remove(currentQuestion);
    yield return new WaitForSeconds(TimeBetweenQuestions);
    SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
    }
    public void UserSelectTrue ()
    {
    if (currentQuestion.istrue)
    {
    AddScore (1);
    Debug.Log("CORRECT!");
    } else
    {
    AddScore(-1);
    Debug.Log("WRONG!");
    }
    StartCoroutine(TransitionToNextQuestion());
    }
    public void UserSelectFalse ()
    {
    if (!currentQuestion.istrue)
    {
    AddScore (1);
    Debug.Log("CORRECT!");
    }
    else
    {
    AddScore (-1);
    Debug.Log("WRONG!");
    }
    StartCoroutine(TransitionToNextQuestion());
    }
    public void AddScore(int newScore)
    {
    scorePoints += newScore;
    UpdateScore ();
    }
    void UpdateScore()
    {
    scoreText.text = "Score: " + scorePoints;
    }
    }

    • @captainc00ltwo
      @captainc00ltwo 7 ปีที่แล้ว

      My text also doesn't appear in game

  • @MegaDestroyer07
    @MegaDestroyer07 6 ปีที่แล้ว

    i followed the same steps , however when i play....my answers come out wrong
    like if i hit answer true .it moves the false button which displays Wrong

  • @Mr2ndAmmendment
    @Mr2ndAmmendment 8 ปีที่แล้ว

    Can you make a series about a game with a 3D character and point to click movement system. Kinda like old school Runescape in Java.

  • @syafiqmuda9762
    @syafiqmuda9762 7 ปีที่แล้ว

    whenever i want in the full screen the box will become larger. how to get rid of this?

  • @dahidd
    @dahidd 8 ปีที่แล้ว

    Sorry for my noobness but I followed the tutorial and it was perfect. I am wondering if anyone knows how i can add sound to the question object. So when the question loads, the question will be read to the player (i will pre-record these sounds for each question)
    I'm assuming i need to add the sound to the question object somehow. I just don't have much experience with c# so this is difficult.

    • @dmitrij34
      @dmitrij34 8 ปีที่แล้ว +2

      +Dahid The data type for sound in unity is AudioClip.
      So you need to add public field of type AudioClip to the question object(for simplicity let's name it QuestionAudio). - now you will be able to set this from inspector.
      Add a AudioSource component to the GameManager.
      Get the reference to the audio source and store it in GameManager(to do that you can add to GameManager a serialized field of type AudioSource(let's name it aSource) and drag it in from the inspector).
      Then - when the question is loaded:
      (in this tutorial it is performed in SetCurrentQuestion())
      aSorce.Clip = currentQuestion.QuestionAudio; //We set audio source's clip to the question's one.
      aSource.Play();

    • @dahidd
      @dahidd 8 ปีที่แล้ว

      +Дмитрий Ковалёв Thank you for your help seriously, you have no idea how much i appreciate it :D i just need to work on the scores now

    • @dahidd
      @dahidd 8 ปีที่แล้ว

      +Дмитрий Ковалёв Thank you for your help seriously, you have no idea how much i appreciate it :D i just need to work on the scores now

    • @dmitrij34
      @dmitrij34 8 ปีที่แล้ว +1

      You are welcome!

  • @dacharizard
    @dacharizard 7 ปีที่แล้ว

    Can anyone help me? When I press the trigger the transition doesn't happen...

  • @kleinerinthelab3492
    @kleinerinthelab3492 4 ปีที่แล้ว

    the WaitForSeconds doesn't work with float numbers, it does with integer, someone knows the reason?

  • @DanielJoseph2002
    @DanielJoseph2002 8 ปีที่แล้ว

    Great video! You've got me really into this coding stuff! But every time I press false it says 'wrong' even if I know that it is the correct answer. I can't figure out how to fix this. Please help!!!!!

  • @martingdunkley
    @martingdunkley 8 ปีที่แล้ว

    How would i prevent multiple button clicks?

  • @peterchristiaanse7585
    @peterchristiaanse7585 8 ปีที่แล้ว

    Nice video!

  • @woodyman0
    @woodyman0 6 ปีที่แล้ว +1

    Thank you for this tutorial! Can you add a tutorial about how to add multi language for questions? ty!