How to make a Quiz Game in Unity (E03 CORE GAME) - Tutorial
In this video we combine our code and UI to finish the core game.
● Get Help: forum.brackeys.com/
····················································································
Learn how to make a simple quiz game in Unity 5.3.4 using C#. In this course we cover topics such as user interface design and simple object-oriented programming.
Difficulty: Beginner to Intermediate.
····················································································
♥ Donate: brackeys.com/donate
♥ Subscribe: bit.ly/1kMekJV
● Website: brackeys.com/
● Facebook: / brackeys
● Twitter: / brackeystweet
····················································································
► All content by Brackeys is 100% free. I believe that education should be freely available to everyone. Want to support me in my mission?
Donate here: brackeys.com/donate/
····················································································
♪ Baby Plays Electro Games
teknoaxe.com/cgi-bin/link_code...
Пікірлер: 261
thank you very much this is the first of tutorials that i have actually followed with minimal errors on my end.. thanks alot
I love this guy. He teachs like pro teachers
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.
Waiting 4 this video. Thanks!
Great tutorial!!!!! Very clear. I hope you will make a part 4!!!!
your face in the bottom right screen motivates me
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.
Thank you very much for your presence!!!!
Very well done congrats, and thank you so much for the video !! :)
Awesome series!
thanks. hope u continue making tutorial for us about unity :D
better than my 3years study. Thanks! :D
hi yellow hair guy good job man carry on im folowing this serie with you ^^
very cool tutorial, thank you very much
i love this series, hope u can make multiplayer quiz game
@alexstrygun4209
3 жыл бұрын
fuck off
thank you so much man. just thank you
Great Guides
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
8 жыл бұрын
blah, who cares honestly
Hey Brackeys great tutorial! Are you able to make a series on a Horror game or Simulator game?
Thank you very much, Brackeys
@Brackeys
8 жыл бұрын
+Sathwiq Sivadas You're welcome :D
@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
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
Nice video!
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.
this guy is just plain awesome tho
Thanks alot mate
thank you so much
You are awsome from italy :)
@FlyingUnosaur
8 жыл бұрын
+Cosmim Krajela but he's awesome everywhere
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.
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?
Hello thanks for the Tutorial! btw how can I end the Question Loop?
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...
Thanks Bro
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.
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?
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?
in this Quiz game one doubt on series 3 in 20.13 minutes , Animation how to select diamond shaped symbol plzz ans me
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??
How Do You Rename The Canvas Animation?I Never Figured That Out.I'm New To Unity
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);
Thank you for this tutorial! Can you add a tutorial about how to add multi language for questions? ty!
Hey! My text can't hide behind the button. It is displaying in front of the button. Please Help!
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
Really Great Job !! Would y create a multiplayer quiz game /??
TransitionToNextQuestion(); on line 36 is at error what would i do to fix this? thank you
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
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 !
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?
How do use this type of script that will enable to still continue the series of question without transtioning the same scene
Guys, if you enjoy the videos, click "I Like", so he will have more visibility!
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?
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
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.
Just opened unity, have 1 week left until project is due, everything is deleted, very, very demotivating
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!!!!!
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
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
i got a question, how do you condition if there are no more question available?
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 .
@ericstricker845
8 жыл бұрын
same
@JasonFireGameplays
8 жыл бұрын
same
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
8 жыл бұрын
kzread.info/dash/bejne/rICi0NKOo9vbYLg.html&lc=z12ng5wbnsnbvzefy23xwnl5cxbgjdosn.1468245861043523
Could you make a tutorial for something like an airplane game? It would be appreciated.
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?
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
If the game is multiple choice how would I get the answers to show up with the randomized question?
How can I make it random without repeating? And after finishing all items, how can I go to the result canvas?
@Sonsho
4 жыл бұрын
Have you figured it out?
Great tutorial Brackey, I will use this to create a quiz game. Have you made other tutorials for score counters?
@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
8 жыл бұрын
+Дмитрий Ковалёв Thanks i'll save this to a text file i have to finish my project by next week :D
@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
8 жыл бұрын
Thanks again!
@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 :/
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.....
hello brackeys..i have some problem here...the placeholder did not swap with the question...thank you #sorryForBrokenLanguage
does microsoft visual studio work for html?
whenever i want in the full screen the box will become larger. how to get rid of this?
can you please tell me when you will out final video of the series........................ fast we all are waiting for your video
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
4 жыл бұрын
@Liam Rahum How would you do it making it multiple choice though?
@johnritchdelacruz471
4 жыл бұрын
i make 4 boolean . then name it a,b,c,d example if(currentQuestion.A) then its correct else false
@pakoulefilou7295
4 жыл бұрын
@Liam Rahum can you write how to do? Please ❤
@pakoulefilou7295
4 жыл бұрын
Ok just same thing but public sprite image_question do the job
@MrJustJessop
4 жыл бұрын
@@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
hai Would u make next episode were theres a fact show up after u answered the question... thx btw
Are there going to be more videos of this lesson
Can you make question cards the code them like a normal question
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
6 жыл бұрын
I too am Facing the same problem...
@SeventeenOof
5 жыл бұрын
ez just download visual stuidos it doesnt take up too much storage and uninstall monodevelop
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
8 жыл бұрын
+Scott Smith Thanks for expressing your opinion, I always appreciate constructive criticism :)
@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
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
4 жыл бұрын
I have this problem: Index was out of range Do you remember if you did it and how?
My mouse cursor is disappearing everytime i click the play button. Can someone help me please?
saved unity, closed it, opened it next day... Some buttons were gone, it disconnected everything that i had the gamemanager assigned to so everything basicly... very demotivating xD
How do we add a score if the scene starts every time
@Ambo100
8 жыл бұрын
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
6 жыл бұрын
How to do this? Pls help :(
Can anyone help me? When I press the trigger the transition doesn't happen...
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
8 жыл бұрын
not in unity 5, you also need unityengine.scene managment now
@pacukluka
8 жыл бұрын
+pacukluka if you want changing scenes that is
So.. i got this problem "ArgumentException: method arguments are incompatible" can someone help me fix it?
Sir how about the record of correct and wrong? to modify how many correct and wrong
How can you change the answers too? Not just true or false.
Brackeys, how can we make it if it was a multiple choice type of question? Let's say we have three choices for the question. Hopefully you or someone replies! Thanks! :)
the WaitForSeconds doesn't work with float numbers, it does with integer, someone knows the reason?
How would i prevent multiple button clicks?
hello sir. how to make the buttons 4? or choice a,b,c,d?? badly needed sir. thank you! your great!! ASAP Please :'(
is it ok if we remove noanswer animation
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
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(); } }
can you make with a score and after the game it can show the score of all the question you answer please make one :)
Not able to change from one question to another.Please help!!!
5:25 my console does not show up messages correct or false pls help asap
@SeventeenOof
5 жыл бұрын
typo?
please help how to make the answered questions not to repeat?
Does anyone know on how to add scores for the True/False game ?
please sir, create a video adding a timer bar and score counter please.
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 !!
@izabelaleticia3l
8 жыл бұрын
me too. you fixed?
@simiondragos4558
8 жыл бұрын
Yep , i fix it , give me a pm so we can talk
@izabelaleticia3l
8 жыл бұрын
+Dragos Simion what "give me a pm" means? i'm brazilian
@simiondragos4558
8 жыл бұрын
private message
@izabelaleticia3l
8 жыл бұрын
I am not able to send you a message
how ca i display the answered question ?
18:41 - lol ignore this is for me 😅😂
Hvilke uddannelser har du taget Brackeys? :D For at blive spil designer