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 /
avatar image
0
Question by GoSlowGames · Sep 15, 2018 at 02:31 AM · script.level

i need help making a multiple level game

ive been messing around an improving the roll a ball game that you can learn in the tutorial and I was wondering if there is a way to make it so once the player collects all the floating cubes it will reset the score and teleport it to the next level I'm trying to make 3 or more levels

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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by oStaiko · Sep 15, 2018 at 03:26 AM

What you want is multiple scenes. A scene is what you build the game in; it can be a level, a menu screen, all sorts of things. If you want to make a new scene that is similar to your current one, hit Save Scene As and give it a name like "level 2". https://docs.unity3d.com/Manual/CreatingScenes.html

Now you want to change levels when certain conditions are met, this is also super easy. To have a near-instant scene change, type in:

 SceneManager.LoadScene("Level2");

https://docs.unity3d.com/ScriptReference/SceneManagement.SceneManager.html

If you are going for super-basic, this is okay. But instant loading is pretty unappealing, so you'll want a delay on it, and some notification or confirmation. You can have a UI panel appear with some text saying "Congrats! Loading new level..." and then have the level change in 3 seconds or so, or when the player click a confirmation button.


Scenes may take a moment to get used to if you havent seen anything like it before. Everything in a scene is deleted and reset when changing and loading a new scene, so any changes to the level will be undone. All non-static and non-persistent variables/objects are also deleted. It is usually not needed for small projects (like this one) to remember things in-between stages, but this can be done by saving/loading data (not reccomended), or with persistent objects.

https://docs.unity3d.com/ScriptReference/Object.DontDestroyOnLoad.html

Comment
Add comment · Show 1 · 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
avatar image GoSlowGames · Sep 15, 2018 at 05:00 AM 0
Share

quick question where would I put that code

Scene$$anonymous$$anager.LoadScene("Level2");

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

97 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

Related Questions

About Creating Levels 1 Answer

Is there a way to create a scene based memory? 1 Answer

Monster clicker based game, need help 1 Answer

How can I loop over all vertices and draw triangles ? I'm getting out of range exception 1 Answer

Point-and-Click Camera movement script 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