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 Magso · Jun 17, 2014 at 11:47 AM · savepathscenesfolder

Saving current scene in another scene during gameplay?

I have 2 scenes in separate folders, one has all stuff in it and the other is empty. How during gameplay can I save the contents from the current scene into the other empty scene, so when I close it and reopen it, I can open the scene I saved everything in and have all the saved stuff in it.

I have seen EditorApplication.SaveScene but I've no idea how to use it, plus I'm not really familiar with C#. And does it even work in the built game (.exe or .app)?

Thanks for any answers.

Comment
Add comment · Show 7
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 HarshadK · Jun 17, 2014 at 11:58 AM 0
Share

EditorApplication.SaveScene is for saving the scene while working in Unity Editor window only and will not work in your standalone. What you need is something like Unity Serializer which allows you to save the scene while gameplay is in progress.

avatar image Magso · Jun 17, 2014 at 01:06 PM 0
Share

Just checked out the Unity Serializer, seems pretty good but does it store the saved states so it comes back to them after I close and reopen the standalone?

avatar image HarshadK · Jun 17, 2014 at 01:10 PM 0
Share

You need to do it by yourself. Unity serializer will allow you to save and load states. You can use checkpoints for that. But creating checkpoints and saving states needs to be done by you.

avatar image Magso · Jun 17, 2014 at 01:20 PM 0
Share

Yes but if I close it and reopen it, will the save list still be the same or will it be cleared?

avatar image HarshadK · Jun 17, 2014 at 01:23 PM 0
Share

You can have save list to still be the same. You can come and load any checkpoint from that list even after you close and re-open the game. All you need to do is save the list to the disk.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by PommPoirAbricot · Jun 17, 2014 at 12:04 PM

Hello

If you mean to load another scene, you can do it with Application.Load("scenename") Then on each object you want to keep while loading the next scene, use

GameObject.DontDestroyOnLoad(yourGameobject);

Does it help you ?

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 Magso · Jun 17, 2014 at 12:50 PM 0
Share

Thanks for your answer, but I meant, can I save the scene, then come back to it if close and open the actual standalone itself, or close and reopening the editor. Harshad$$anonymous$$ has noted that it doesn't work in that way. Thanks anyway.

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

22 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

Related Questions

AssetDatabase current folder? 2 Answers

What is the difference between Path.GetTempPath() vs Application.temporaryCachePath 0 Answers

How to set and save individual highscores for each scene using serialization? 3 Answers

How can I put a mp3 in the iphone documents folder then load it with www? 1 Answer

editor folder path on Mac 0 Answers


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