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 Jalah_LLC · Apr 03, 2016 at 03:26 AM · sceneslevelspopupgameovernext level

How to have a Next Level and Game Over pop up in scene please help!

Hey everyone. I am kind of stuck and was wondering if anyone can help me on this or point me in the right direction. I have a game in which it is level based. Each level I have is a different scene. Is it possible to create a pop up within a scene for next level and game over? Like flow free when you complete the level this comes up:

alt text

I do not want to create separate game over and next level scenes. Is something like this possible? And if so, would this be applied to every scene? Or can I make it within one scene and have a script to apply it to every scene? ANY help with this or pointing me in the right direction would be GREATLY appreciated. Thank you!

unnamed.png (93.4 kB)
Comment
Add comment · Show 1
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
avatar image Namey5 · Apr 03, 2016 at 06:46 AM 0
Share

http://docs.unity3d.com/ScriptReference/$$anonymous$$onoBehaviour.OnGUI.html

http://docs.unity3d.com/ScriptReference/GUI.html

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by $$anonymous$$ · Apr 03, 2016 at 08:18 AM

Well you can play with UI.You create a panel and you can deactivate it,then when you end your level you can enable it via script something like this

Look this

using UnityEngine;

using UnityEngine.UI;

using System.Collections;

public class PlayerController : MonoBehaviour {

 public float speed;
 public Text countText;
 public Text winText;
 private Rigidbody rb;
 private int count;
 public AudioSource audio1;
 public GameObject EndPanel;//This gameobject is the panel

 void Start ()
 {
     rb = GetComponent<Rigidbody>();
     count = 0;
     SetCountText ();
     winText.text = "";
     EndPanel.SetActive (false);//This keep the panel inactive
 }

 void FixedUpdate ()
 {
     float moveHorizontal = Input.GetAxis ("Horizontal");
     float moveVertical = Input.GetAxis ("Vertical");

     Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);

     rb.AddForce (movement * speed);
 }

 void OnTriggerEnter(Collider other) 
 {
     if (other.gameObject.CompareTag ( "Pick Up"))
     {
         audio1.Play();
         other.gameObject.SetActive (false);
         count = count + 1;
         SetCountText ();
     }
 }

 void SetCountText ()
 {
     countText.text = "Count: " + count.ToString ();
     if (count >= 12)
     {
         winText.text = "You Win!";
         EndPanel.SetActive (true);//You win the game so the panl is active
     }
 }

} If you want subscrube to my channel I 'm making simple tutorial https://www.youtube.com/channel/UCCV5S5GAp-sXr4EB-a1TYUA

Comment
Add comment · Share
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

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

54 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

Related Questions

How to passing levels automatically in games? 0 Answers

How to Manage Objects Common for Multiple Levels? 2 Answers

2+ level Popup on InspectorGUI 1 Answer

Cannot access LevelChanger to change level from the pan/delay coroutine in CameraPanForIntro 0 Answers

I'm trying to make my timer stop and display on the level complete scene 0 Answers


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