Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by p2hari · Sep 22, 2017 at 07:06 PM · scripting problemgameobjectgraphics

Roll a ball and quiz (Pause scene, load scene and resume)

Hello Guys,

First I am very new to Unity and Csharp scripting. But for this question I have searched google, forums and looked into tutorials but not finding the right way to handle it.

Well basically I am using the Roll a ball tutorial and I am making a simple quiz game on top.

When the ball hits 3 objects, I load the quiz scene and ask a question. On answering the question, the game should resume and if the answer is correct it should add it to the count value.

Problem. On hitting the 3 objects I load the scene but on answering the question , when I return the game won't resume and it stays there.

What I have done so far. My first approach LoadScene

void OnTriggerEnter(Collider other) { if (concount == 3) { if (qcallcount <= 2) { concount = 0; qcallcount = +1; Time.timeScale = 0; SetScene(); } }

     // Run the 'SetCountText()' function (see below)
     SetCountText();
 }

} public void AddCount(int points) { count = +points; SetCountText(); }

private static void SetScene() { SceneManager.LoadScene("Questions"); }

In my questions gamecontroller

public void AnswerButtonClicked(bool isCorrect) { if (isCorrect) { playerScore += currentRoundData.pointsAddedForCorrectAnswer; questionIndex++; ReturnToGame(); }

 }
 public void ReturnToGame()
 {

SceneManager.LoadScene ("Roll-a-ball") }

This is loading 2 instances of the Roll a ball

2nd Approach LoadScene Additive

In my ontriggerenter I load the questions with LoadScene Additive Then I set my question display panel to false in the ReturnToGame() questionDisplay.SetActive(false);

But this results in error "To many event systems , not supported " and the game does not resume and it is always paused

3rd Approach UnloadScene

I did Unload my scene (questions) but the game does not progress and the data is also lost.

PS: I set Time.timescale = 1; in fixed update so that I can resume the game, I also tried Time.timescale = 1 in update, but no success.

Please guys need your help in understanding how I can achieve this ?

I need to collect x objects, then pop a question, Now once user answers it I have to return to roll the ball and continue. I keep doing this till all objects are cleared or if all questions are completed. I need to track the right answers and add to users score.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

197 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to change value of another gameobject through script 2 Answers

Texture turn black and Gameobject become half or unseen-able 0 Answers

Framing multiple objects from a list along y axis only? 0 Answers

Why is the this object referenced to itself? 1 Answer

Collision only counted first time 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges