Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 Aleron · Oct 14, 2011 at 03:39 AM · loadinglevelasset bundles

Application.LoadedLevelName for level loaded from asset bundle isn't set

After building an asset bundle for a scene using BuildPipeline.BuildStreamedSceneAssetBundle() I can load the scene from the bundle just fine using Application.LoadLevel(). However, Application.LoadedLevelName is an empty string. This doesn't seem right to me.

I can understand Application.LoadedLevel being -1 (the value it returns for a scene loaded from an asset bundle), but since the scene was loaded using its name, it baffles me that Application.LoadedLevelName should be empty. Am I missing something? Is this a bug? or is it intended behavior?

I've tried searching here and various other sites and haven't managed to find anything dealing with these variables directly when loading scenes from an asset bundle. I know I can write my own wrapper for loading levels and tracking the name, but I'd prefer to utilize the built in functionality of Unity as much as possible.

Thanks!

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 figs999 · Mar 10, 2012 at 11:13 AM 0
Share

This does in fact seem to be a bug, at least non-intuitive behavior. I ran into the same problem and was able to work around it by storing the string name of the scene I loaded in a separate variable. I was able to load the level using this variable as the parameter but not with LoadedLevelName. For some reason LoadedLevelName is not being populated with the name from the scene loaded via an Asset Bundle.

1 Reply

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

Answer by Dreamora · Oct 14, 2011 at 04:33 AM

This is intend behavior I assume because you could have unloaded the asset bundle by now with the unload(false) so loadlevel with the name would no longer work and thats exactly the use case for which LoadedLevelName is there, to reload the current level.

in any other case you would have another reference or something 'telling you where you are' cause you need to know what the next level is or management stuff about the current one

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How can I store and load levels efficiently? 2 Answers

scene loader issue 0 Answers

Storing in PlayerPref based on timer 1 Answer

Scene starts before scene loading is finished 0 Answers

How would I go about making an open world game? 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