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
8
Question by MrBearHat · Dec 16, 2015 at 01:14 PM · c#scenescene-loadingnot working

Application.LoadLevel obsolete but SceneManager.LoadScene Doesn't work

So this is probably a stupid question but i'm stumped. So i tried to run this using Application.LoadLevel to load this but unity tell me that using that method is obsolete and said to use scenemanager.loadscene instead however i get the error. CS0103 The name 'SceneManager' does not exist in the current context

i really and stumped and dont know what to do...

 using UnityEngine;
 using System.Collections;
 
 public class ClickToChange : MonoBehaviour {
     
     void OnMouseDown()
     {
         SceneManager.LoadScene("Menu_Level");
     }
 }
Comment
Add comment · Show 2
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 14ercooper · Dec 16, 2015 at 01:20 PM 0
Share

Do you have the scene manager imported? Does scene manager need to be instantiated before being run?

avatar image dreg_master · Dec 13, 2016 at 01:17 PM 0
Share

Thank you for asking this question, i had the exact same problem till i came here :)

5 Replies

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

Answer by tanoshimi · Dec 16, 2015 at 01:29 PM

You're missing:

 using UnityEngine.SceneManagement;

at the top of your class.

Comment
Add comment · Show 6 · 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 mikelortega · Dec 16, 2015 at 01:31 PM 2
Share

Or this? ;)

 Scene$$anonymous$$anagement.Scene$$anonymous$$anager.LoadScene("$$anonymous$$enu_Level");
avatar image Khozo · Dec 16, 2015 at 02:04 PM 0
Share

Is there actually anything wrong with Applicaion.LoadLevel and Application.LoadScene? It seems to work fine for me but Unity keeps telling me it isn't.

avatar image mikelortega Khozo · Dec 16, 2015 at 02:07 PM 0
Share

Application.LoadLevel is obsolete and will be removed in future versions.

avatar image tanoshimi Khozo · Dec 16, 2015 at 02:13 PM 0
Share

Unity 5.3 introduced multi-scene handling, and that's what the Scene$$anonymous$$anager class is designed to do. The old Application.LoadLevel still works, but it's deprecated - which means that it's no longer the recommended way to do it, and this is a feature that may stop working in future versions.

avatar image MrBearHat · Dec 17, 2015 at 05:27 AM 0
Share

Thank you so much. It worked, can't believe that I didn't think of that.

avatar image AndrewBilotti · Feb 22, 2016 at 09:12 PM 0
Share

THX :) no mor obsolete 4 me!

avatar image
0

Answer by Boggs · Dec 18, 2015 at 08:20 PM

I remember hearing about the multi-scene feature in a live training course, did not know that update happened. Good to know thanks!

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
avatar image
0

Answer by superdiederik · Dec 22, 2015 at 09:07 AM

Application.LoadLevel is giving me crashes under Unity 5.3.1f1 (64-bit) so I suggest we all move to using the using UnityEngine.SceneManagement a.s.a.p.

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
avatar image
0

Answer by Unity_scat · May 07, 2016 at 05:04 AM

looks like the updated version of Application.LoadLevel (SceneManager.LoadScene) only works in c#

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 Unity_scat · May 07, 2016 at 05:01 AM 0
Share

@Unity_scat

no errors but it still doesn't work... Unity needs to fix this

avatar image LUKS123456 · May 19, 2016 at 04:37 PM 1
Share

The scene manager works fine in Js too! You only need to write the script like this:

 Scene$$anonymous$$anagement.Scene$$anonymous$$anager.LoadScene("SceneName");

With the "Scene$$anonymous$$anagement." before the usual C# format.

avatar image Honorsoft · Sep 16, 2017 at 07:02 PM 0
Share

I tried LU$$anonymous$$S123456's simple one line call: Scene$$anonymous$$anagement.Scene$$anonymous$$anager.LoadScene("SceneName"); No imports, declarations...A$$anonymous$$AZING! Thanks LU$$anonymous$$S. I expected an error but it works! So I guess Unity's Scene $$anonymous$$anager is referenced directly from the JS script. Does that apply to other components? Probably. The normal way to do that was:

import UnityEngine.Scene$$anonymous$$anagement; //at the top of the JS script, then to call it: Scene$$anonymous$$anager.LoadScene("SceneName");

Even in C# you have to declare 'using UnityEngine.Scene$$anonymous$$anagement;' I tried the Scene$$anonymous$$anagement.Scene$$anonymous$$anager.LoadScene("SceneName") without any declarations (just the one line) and it worked, that's even better (simpler) than C#'s Scene $$anonymous$$anager access. I am not as familar with java though, mostly C++ and C#, so thanks LU$$anonymous$$S.

avatar image
0

Answer by HamzaLk · Jul 16, 2017 at 04:26 PM

why switching?! load level was good right? anyway...

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

15 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

Related Questions

Unity Scene not loading. 1 Answer

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Can I build a scene once and have it be importable? 2 Answers

How scene loading works? 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