Search Unity

[RELEASED] Trivia Quiz Game Template

Discussion in 'Assets and Asset Store' started by puppeteer, Sep 25, 2015.

  1. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Hi guys, I just got a review from a customer who had a whole bunch of errors appear when downloading the template for Unity 2019.1.0f2.

    I checked this version myself and found the source of the errors.The errors are TextMeshPro cache, which are related to a package that Unity installs by default in version 2019.1, but are not needed at all for Trivia Quiz.

    Once this package is removed all the errors disappear. You can do that quickly by going from the top menu to Window > Package Manager and removing the TextMeshPro package.

    upload_2019-4-25_13-30-33.png

    Another thing to do if you want to keep the TextMeshPro package is to switch to NET4.0 in the PlayerSettings:

    upload_2019-4-25_13-39-17.png
     
    Last edited: Apr 25, 2019
    hopeful likes this.
  2. yogathipan86

    yogathipan86

    Joined:
    Sep 20, 2018
    Posts:
    2
    Hi Puppeteer..
    I've been using this in my school computer and the kids are going through the quizzes. Can i know how can i collect the data of the score, name of the student and their class in excel format so i can have my record of students quiz score.??
     
    puppeteer likes this.
  3. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Not sure about directly to Excel, but maybe you will find use in the Share By Mail feature which allows students to post their score and other info directly to the teacher's mail.

     
  4. yogathipan86

    yogathipan86

    Joined:
    Sep 20, 2018
    Posts:
    2
    Thanks for your reply. Yes this work for email but is there any way the data can be stored locally. Not all our computers is powered with internet access.
     
  5. neilcaguioa123

    neilcaguioa123

    Joined:
    May 19, 2019
    Posts:
    3
    how to build always saying this unity unable to sign application please provide passwords
     
    puppeteer likes this.
  6. neilcaguioa123

    neilcaguioa123

    Joined:
    May 19, 2019
    Posts:
    3
    i really need to build this sir and test it on mobile
     
  7. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    The password it requires is for the keystore code which is needed when uploading an APK to android Google Play store. You can read about doing it for any unity android game here:



    But in order to test your game on mobile you don't need to create a keystore, you can simply select Unsigned Debug and build the game without a keystore.

    upload_2019-5-20_0-24-7.png
     
  8. neilcaguioa123

    neilcaguioa123

    Joined:
    May 19, 2019
    Posts:
    3
    thanks sir btw how to show score offline?
     
    puppeteer likes this.
  9. SarcasticRobot

    SarcasticRobot

    Joined:
    Jun 19, 2019
    Posts:
    2
    I have recently downloaded Trivia Quiz Game Template and when I went to test it in Unity I got two errors, both saying

    "error CS0619: 'MovieTexture' is obsolete: 'MovieTexture is removed. Use VideoPlayer instead.'"

    One of these errors was in 'Answer.cs' and the other in 'Question.cs'. I saw there was a post from a while ago that mentioned something about MovieTexture, but I am not sure if that is the same issue. I was wondering if I could get information on if this error is something that I have done wrong on my end and how to fix it, or what this could be about.
    Thank you
     
    puppeteer likes this.
  10. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    The leaderboard is an online url, I don't think you can display it offline.
     
  11. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    In general I decided to avoid using videos in the package since all the changes and limitations that are part of it, so it only supports text/images/sounds but no video.

    Which version shows the error? And does it prevent the project from running?
     
  12. SarcasticRobot

    SarcasticRobot

    Joined:
    Jun 19, 2019
    Posts:
    2
    Yeah, if I can just delete some files or lines of code to get rid of the video thing, that's good with me since I won't need to use videos.
    I believe that I am using version 1.99f2 of the Trivia Quiz Game because that is what is shown in the documentation.pdf that is downloaded when I import it into Unity and I am trying to run it on 2019.3.0a5 of Unity.
    It does prevent the project from running. When I try to hit play in Unity, a pop-up comes up saying that 'all errors need to be fixed before you can enter playmode' and the only errors in the console are the ones I mentioned in the first post. When I click on the errors, these are the files it loads up, with MovieTexture being underlined as the error. I have tried to just comment out that area of code but it creates a lot more errors when I do that.
    Capture.JPG Capture2.JPG
     
  13. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I commented off the video/MovieTexture related code, check your private messages for a script you can test out.

    Note that this is specific to 2019.3, as I plan to completely remove it from future versions.
     
  14. dangnguyen113

    dangnguyen113

    Joined:
    Aug 8, 2017
    Posts:
    7
    Hi everyone, how to custom delay time hide answer, show answer correc or incorrect, and next question?
     
    puppeteer likes this.
  15. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Hi, (I also answered your mail)

    You can edit the time delay before hiding the answer here:

    upload_2019-6-28_20-40-35.png

    And you can set how long a question time for each question here:

    upload_2019-6-28_20-40-35.png

    And you don't need to edit animation for this, just in the script and editor.

    Try these and tell me if they worked for you!
     
  16. celestial1

    celestial1

    Joined:
    Mar 21, 2018
    Posts:
    1
    Hello, for some reason, pictures in questions are not showing up for me, like from the start in fresh import of the app, it just does not work.
     
    puppeteer likes this.
  17. unity_Kx8_VU3cSgT_aA

    unity_Kx8_VU3cSgT_aA

    Joined:
    Jul 22, 2019
    Posts:
    2
    Hi, my question is, does this app support ads reward video and intertial ads? thankyou :)
     
  18. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Hi, is this for all game modes or just for specific modes like XMLImport?

    I have a couple of example videos showing how to use UnityAds in the package, you can take a look here:

     
  19. unity_jMysOfgsseaifA

    unity_jMysOfgsseaifA

    Joined:
    Feb 21, 2019
    Posts:
    3
    Hi,

    I'm having an issue with categories and the lock/unlock feature. To create my categories, I duplicated an existing category multiple times (I needed 18 categories). When previewing, I notice that now when the category I duplicated is solved, all the categories created from that category are unlocked. How do I "unlink" or "uncouple" the newly created categories from the original category? If I can't, what is the better way to create categories?

    Thanks!
     
    puppeteer likes this.
  20. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    When modifying the category, make sure that it has a unique name here:

    upload_2019-7-28_8-42-57.png

    It's a bit confusing maybe because there is the actual Prefab name "Category7" that just defines the object name, and the component name "Category 7" which is the one that defines the lock state of the category in a local save.
     
  21. unity_jMysOfgsseaifA

    unity_jMysOfgsseaifA

    Joined:
    Feb 21, 2019
    Posts:
    3
    Thanks for the prompt response. I should have mentioned that I had changed the names, colours, and icons before contacting you.

    Looks like I found the solution, however. After your message, I went back and checked each name in the inspector window and found I had included spaces in some category names. Removing the spaces fixed the issue, so that's great, but now I have to ensure there are no spaces in the category name (for the record, I didn't include spaces in the prefab name in the project window).

    In your posted example, the category name is "Category 7" with a space between Category and 7. When I include that space, it links the copied category with others which don't even share the name. For now, I'll just ensure I use no spaces, but if you can think of a solution/workaround, please let me know.

    Thanks again
     
    Last edited: Jul 28, 2019
  22. unity_jMysOfgsseaifA

    unity_jMysOfgsseaifA

    Joined:
    Feb 21, 2019
    Posts:
    3
    Hi again Puppeteer,

    I'm tweaking the category functionality a bit and thought my struggles might be useful for the community.
    1. I didn't see a toggle for showing/hiding locked category names and I wanted game players to see what was to come, so I commented it out of the TQGCategoryGrid.cs script:
      • // Display the locked message instead of the category name​
        //newCategory.Find("Text").GetComponent<Text>().text = lockedMessage;
        If there is a built-in solution I missed, let me know!
    2. Is there a way to lock previously played categories as new categories get unlocked? I want players to progress continuously without replaying a category.
    Much appreciated!
     
  23. UDN_165a1249-a0c9-4099-8ba0-53daf2789359

    UDN_165a1249-a0c9-4099-8ba0-53daf2789359

    Joined:
    Nov 1, 2016
    Posts:
    17
    Hi, iam same problem, pictures in questions are not showing up for me, like from the start in fresh import of the app, it just does not work. Its for all game modes. iam using Unity 2019.1.10f1 Please help

    This is the error:
    TriviaQuizGame.TQGGameController+<LoadImageFromURL>d__115.MoveNext () (at Assets/TQGAssets/CS_Assets/CS_Scripts/TQGGameController.cs:2277)
    UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Scripting/Coroutines.cs:17)
     
    puppeteer likes this.
  24. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I submitted the update to the store, it should be accepted in several more days.

    In the meantime you can update the code like this in TQGGameController:

    upload_2019-9-26_10-18-6.png

    Here's the updated line of code for copying:


    Code (CSharp):
    1. if (questions[currentQuestion].answers[index].imageURL != null && questions[currentQuestion].answers[index].imageURL != String.Empty)
    2.  
     
  25. UDN_165a1249-a0c9-4099-8ba0-53daf2789359

    UDN_165a1249-a0c9-4099-8ba0-53daf2789359

    Joined:
    Nov 1, 2016
    Posts:
    17
    Hi, I changed the code on line 909 TQGGameController script, still no joy. same problem, pictures in questions are not showing up.....

    NullReferenceException: Object reference not set to an instance of an object
    TriviaQuizGame.TQGGameController+<LoadImageFromURL>d__115.MoveNext () (at Assets/TQGAssets/CS_Assets/CS_Scripts/TQGGameController.cs:2277)
    UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Scripting/Coroutines.cs:17)

     
  26. UDN_165a1249-a0c9-4099-8ba0-53daf2789359

    UDN_165a1249-a0c9-4099-8ba0-53daf2789359

    Joined:
    Nov 1, 2016
    Posts:
    17
    Hi, just did update, and now it shows pic, but its shows same pic for all the questions that have pic in them questions.
     
    puppeteer likes this.
  27. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I found the problem, it's not the code :|

    upload_2019-9-26_22-20-6.png

    Sometimes Unity duplicates a component when applying prefab changes. In this case it created another Image component so it covered the real loaded image.

    So for now just remove one of the components.
     
  28. UDN_165a1249-a0c9-4099-8ba0-53daf2789359

    UDN_165a1249-a0c9-4099-8ba0-53daf2789359

    Joined:
    Nov 1, 2016
    Posts:
    17
    Excellent Thank you, works perfect now.. Much appreciated
     
  29. dreamhub

    dreamhub

    Joined:
    Sep 17, 2019
    Posts:
    9
    When i insert an image to an answer button, the image is not displayed, what should i do? upload_2019-9-27_17-41-25.png
     
  30. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    It seems to work fine in the scene here:

    upload_2019-9-27_13-29-10.png

    Is there any other error message that appears when the image doesn't? Is there an Image component on the answer object.
     
    dreamhub likes this.
  31. dreamhub

    dreamhub

    Joined:
    Sep 17, 2019
    Posts:
    9
    there is no image component on the answer object
     
  32. dreamhub

    dreamhub

    Joined:
    Sep 17, 2019
    Posts:
    9
    how do i put the image component on the answer object? btw there is no error popping up. thank you for the help.
     
  33. dreamhub

    dreamhub

    Joined:
    Sep 17, 2019
    Posts:
    9
    can i also ask, can i remove the xml component in the code? is that possible? because we won't need it on our project.
     
  34. dreamhub

    dreamhub

    Joined:
    Sep 17, 2019
    Posts:
    9
    all i asked is now okay, we used the image answer quiz game. why cant i resize the buttons in the game. it is in landscape and i want it to be in portrait, when i changed the resolution the buttons got bigger and i cant resize it. i already searched but it is not working.
    upload_2019-9-29_20-38-28.png
     
    puppeteer likes this.
  35. dreamhub

    dreamhub

    Joined:
    Sep 17, 2019
    Posts:
    9
    here is my last question, how do i remove the zoom function of the question and just let the image resize on its own in the question panel. because the zooming if the question is not appropriate for our questions.

    upload_2019-9-29_22-8-15.png

    sorry for so much questions, im using unity for only 3 weeks and just bumped with your template. thanks.
     
    puppeteer likes this.
  36. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Take a look at the parent object holding all the answers. It contains a GridLayoutGroup component which controls the answer buttons inside and orders them in a grid shape.

    upload_2019-9-29_19-7-6.png

    You can edit these values to make the grid as you want, or you can remove this component to make the buttons free to change.
     
    dreamhub likes this.
  37. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    You can control the zoom value in the GameController of the scene, here:

    upload_2019-9-29_19-8-23.png
     
    dreamhub likes this.
  38. dreamhub

    dreamhub

    Joined:
    Sep 17, 2019
    Posts:
    9
    Thank you so much, you are the best. Much appreciated, Sir!
     
    hopeful likes this.
  39. dreamhub

    dreamhub

    Joined:
    Sep 17, 2019
    Posts:
    9
    I used my own question panel and answer panel but the images of the answer and questions are not displaying, what should i do?
    upload_2019-9-30_3-18-31.png
     

    Attached Files:

  40. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Not sure what it could be, are you getting any error message in the console?

    BTW, is the quiz area really black like that with red lines? Or is this part of the problem?
     
  41. dreamhub

    dreamhub

    Joined:
    Sep 17, 2019
    Posts:
    9
    There was no error on the console. i just made another image for the panel and i put it on top of the answer buttons and it worked fine. By the way, those red lines are part of the background. Thank you for being responsive.
     
    puppeteer likes this.
  42. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    No problem, glad that it works now. Good luck with your project!
     
    dreamhub likes this.
  43. Artomiano

    Artomiano

    Joined:
    Dec 1, 2014
    Posts:
    200
    Hi puppeteer,

    it was long ago. ;) Do you still know me? Many months I waited for a solution for an online leaderboard. I found, that you provided some information regarding dreamlo. I live in germany. And here I have a great problem with this solution: Data is stored on servers out of germany. Regarding GDPR, I have to check some rules in use of personal data, like names. So I need a solution which can store the highscore data on my own server.

    But hey, it's great, that you found something. Unfortunately, it doesn't help me. :(
    So my search will go on...
     
    Last edited: Oct 8, 2019
    puppeteer likes this.
  44. tupacrap

    tupacrap

    Joined:
    Oct 22, 2019
    Posts:
    3
    Can you implement Admob? Do you have any guide? I would like to buy the script but want to know if I can implement it. Is unity ads enough for making some revenue? Anyone which used it ?
     
    puppeteer likes this.
  45. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Hi, unfortunately I don't have any experience with AdMob. I only made the UnityAds vid. I saw other users implemented AdMob and other systems, but I haven't done it myself.

    Regarding performance of ads, there are several places to do a comparison with admob and other networks, like this one for example:

    https://techmintle.com/unity-ads-vs-admob-reviewed/
     
  46. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Hi! Even if people forget, the Internet doesn't :D

    Actually maybe this guy from the dreamlo website has a way to allow it to be stored someplace else? I haven't tried it but I did contact him for example to give access to https and he did that for a small payment. Don't know if he has other options, but it's worth a try:

    http://dreamlo.com/contact/
     
  47. tupacrap

    tupacrap

    Joined:
    Oct 22, 2019
    Posts:
    3
    -how i could add an share score button ? could you add it in future updates ?
    - how can i move the main menu buttons when i uncheck the grid layout group without the buttons going crazy ( when i test on phone the buttons are out of the camera .)
    - i need to use ș and ț . how can i implement these because when i use those in a question they appear like "?"
    - can.t append xml directly to a certain category. importing works .. but i need the append feature
     
    Last edited: Oct 25, 2019
    puppeteer likes this.
  48. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    1- I have a share-by-mail button in the package which is used by students to share their score to their teachers mail.


    You can read about sharing to mail in the documentation file in the project folder:
    upload_2019-10-26_14-16-15.png


    2- In addition to the grid layout group component, you'll see there is another component called TQG Dynamic Grid which overrides the regular grid component. This one checks to see if we are using the game in portrait(vertical) or landscape(horizontal) mode and affects the grid accordingly. So depending on how you want to display your app you should make the changes to the grid parameters there. Or if you don't want these at all you can remove that component.

    upload_2019-10-26_14-27-0.png

    3- This depends on the font that is used. Try to import (drag and drop into project folder) and different font that can use those characters natively and see if they appear correctly.

    4- I'll take a look at that and see what's causing the null reference error.
     
  49. tupacrap

    tupacrap

    Joined:
    Oct 22, 2019
    Posts:
    3
    1. I need a button to share directly on social sites, for example facebook/twitter/messenger etc. ..
    2. ok thx. btw , how can i make the game to switch automaticaly in portrait/landscape when i play it on the physical phone ?
    3.thx
    4.thx.
    5.you said that you have some experience with the unity ads.. how can i implement an banner in the bottom of the game ? unity banner .. i think that interstitial ads become annoying after some time making people unninstalling the game ..
     
  50. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    1. Unfortunately I don't have such a button natively in the package.
    2. In Project Settings > Player Settings you can choose how the device rotates ( or not ). If you set Auto Rotation you can choose which orientations are allowed and which are not. Like this:

    upload_2019-10-27_9-9-58.png

    5. You can copy the banner ad here and use it to display a banner on the screen itself:

    https://unityads.unity3d.com/help/unity/integration-guide-unity#rewarded-video-ads