• 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 ios.digitaldividend · Jan 15, 2016 at 04:55 PM · unity 5sceneloadingadditiveloadleveladditive

How To Load Next Scene in Unity 5.3 Version without Destroying any GameObject?

Hello Everyone in Unity community! Im new to unity. i have used a little bit unity version 4.5 before but now im going to use unity Version 5.3. its changed. well how can i load a scene over another scene in this version.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by mikelo · Jan 15, 2016 at 05:03 PM

Use this:

SceneManagement.SceneManager.LoadScene(int or string);

string would mean the name of the scene to load.

int would mean the index of the scene in the Build Settings to load.

Comment
Add comment · Show 3 · 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 ios.digitaldividend · Jan 19, 2016 at 12:51 PM 0
Share

im sorry #mikelo but what u wrote it destroy the previous scene(Objects) that were loaded. Like("LoadLevelAdditive()") is there any way?

avatar image mikelo ios.digitaldividend · Jan 19, 2016 at 12:59 PM 0
Share

Then use the second parameter, LoadScene$$anonymous$$ode, and set it to Additive:

 Scene$$anonymous$$anager.LoadScene(xxx, LoadScene$$anonymous$$ode.Additive);

Another option, protect the objects you want to keep with Object.DontDestroyOnLoad.

avatar image ios.digitaldividend mikelo · Jan 19, 2016 at 01:06 PM 0
Share

yep i got it about the LoadScene$$anonymous$$ode. thanx #mikelo.

avatar image
1

Answer by kristoof · Jan 19, 2016 at 05:02 PM

can i use something like Application.loadLevel(Application.loadedlevel +1); ?

Comment
Add comment · Show 2 · 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 mikelo · Jan 19, 2016 at 05:12 PM 0
Share

That code looks right if you check that Application.loadedlevel+1 exists.

But take into acount that Application will be deprecated in future versions. You should use Scene$$anonymous$$anager ins$$anonymous$$d.

avatar image kristoof mikelo · Jan 19, 2016 at 05:23 PM 1
Share

yep upgraded to 5.3 and its not working i just really not like scenemanager :c

anyone else want to use the code above in utnity 5.3 :

 int indexSC = Scene$$anonymous$$anager.GetActiveScene().buildIndex;
         Scene$$anonymous$$anager.LoadScene(indexSC +1);

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

UNET Multiple online scenes 0 Answers

Using Open Scene Additive turns objects in Scene Editor black 1 Answer

Big scene weight in apk 1 Answer

Unity loads things from another scene?,Unity loads 2nd scene when it shouldn't? 0 Answers

Having Brick Game Play while loading same scene again 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges