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 ekeldevious · Nov 11, 2014 at 07:35 PM · multiple objectsmultiple-objectsrandomizing

Can scenes be converted into objects?

Is there a process or function that can convert a scene into a compound object? I am building a randomly generated maze and have several different parts of the maze saved in multiple scenes. Is there a way to take a scene an make into a empty object with all other objects in the scene parented to it? this would be a really useful feature, especially in random generation. 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 MrSoad · Nov 11, 2014 at 07:38 PM 0
Share

Could you convert your maze sections from different scenes into prefabs. Then assemble these on the fly in a single scene ins$$anonymous$$d?

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Jeff-Kesselman · Nov 11, 2014 at 07:37 PM

yes and no.

No you cannot "convert a scene into an object". A scene has much more information then an object.

However what you CAN do is make a prefab of the part of the scene Hierarchy you wish to transfer, and then export a package with that prefab in it.

You can also programmatically load a scene into another one, however thats fraught with peril and probably not what you really want.

Edit: it occurs to me, though you didn't say this, that you may mean you want to do this at runtime of the game.

The only way to do that is to make prefabs and export them as bundles. Bundles are a pro feature.

Comment
Add comment · Show 5 · 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 MrSoad · Nov 11, 2014 at 07:49 PM 0
Share

Could he not make it a prefab in one of his scenes and then just add at runtime in another scene. All his maze parts are, from the sound of it, already in the same project.

avatar image Bunny83 · Nov 11, 2014 at 07:49 PM 0
Share

Just want to add that AssetBundles aren't required for having parts of the scene stored in prefabs. AssetBundles are just a way to load assets at runtime which aren't part of the project when the project got build. Also exporting as package is only needed when you want to transfer those assets into a different project,

avatar image b1gry4n · Nov 11, 2014 at 08:06 PM 0
Share

using LoadLevelAdditiveAsync (pro only):

http://docs.unity3d.com/ScriptReference/Application.LoadLevelAdditiveAsync.html

it is possible to do what you are asking. In your individual scenes parent all your objects to a gameobject with a meaningful name.

There is no way to get that object after the async load is complete unless you use GameObject.Find();

http://docs.unity3d.com/ScriptReference/GameObject.Find.html

The good thing about loading additive async is that it will bring the assets into your scene on a separate thread. I have tried this with a number of tiles loaded during runtime and it worked alright. The best solution I found (and the least framerate intrusive) is to just run the random generation at the very start of your game. Since you are bound to have a load time, load all the prefabs into the scene at that point and just turn them off/on based on player position

avatar image Jeff-Kesselman · Nov 11, 2014 at 08:27 PM 0
Share

Right, bundles are oly if you want to load new assets at run time. Thought I made that clear shrug

avatar image Bunny83 · Nov 11, 2014 at 09:55 PM 0
Share

@b1gry4n: There's also LoadLevelAdditive which doesn't require Unity pro. The "async" versions (which are pro only) are just non blocking calls as they load the scene in the background. For small scenes you might not even notice the small hiccup when using the non-async version. However you're right about accessing the objects contained in the scene.

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

Static variable problem when using same script on multiple objects! 1 Answer

Best pipeline to import multiple weapons into Unity for characters? 2 Answers

Putting Together Multiple Rigged Models 1 Answer

How can i set multiple Texture or Sprite with script? 1 Answer

How to stop a random string generator from repeating a string consecutively? 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