Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
2
Question by chartinboy · Jan 08, 2012 at 03:03 PM · editorscenesavelevel

Saving a scene within the game?

Hi,

I'm nearing completion of my project now, and have begun work on a map creation tool. It's a fairly simple one at it's core, it allows you to place pre-made prefabs on a grid, to create a map.

However, I now want to be able to save the maps I create in the map creator. i want to save them as an entire scene, but without the Map creation object that was used to make it.

Is there some unity reference for saving to a scene file, and similarly can I do somehting along the lines of:

Unity.BeforeSaveScene () { destroy (Map creation unit); }

Unit.SaveScene;

Comment
Add comment · Show 3
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 syclamoth · Jan 08, 2012 at 03:12 PM 2
Share

You can't save scenes at runtime. You need to use an editor script for this.

If you save the file as some other format which gets loaded in using file IO methods and then parsed into an actual level, you can do that at runtime. However, this doesn't use the full functionality of the Unity editor, unless you write that yourself.

avatar image DannyB · Jun 05, 2013 at 03:13 PM 0
Share

Good question. I also want to create a standalone EXE level editor, to let people edit levels, and save unity scenes (and not custom files that represent the scene).

avatar image Tanoshimi2000 · Sep 02, 2014 at 08:23 PM 0
Share

This is something I wish the Unity $$anonymous$$m would enact. I create a scene fabulously and easily with the editor, then my character/player runs around and moves things/destroys things. Why wouldn't they give us the ability to SaveAs that scene during runtime?

Sure, I can write a very simple script that will foreach every single gameobject and output is essential data, but it just seems to me like this should be inherent using the built in scene loaders.

1 Reply

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

Answer by NextGenGameDesigner · May 23, 2012 at 06:59 PM

You can't save scenes but you can have saves of custom maps using file IO in the same exact scene every time. A example would be:

1.On save map store the prefabs Vector, and names in a file. 2.On map load read the file and instantiate prefabs accordingly.

The save file could look like this:

//Prefab Vector3, name, and Rotation 0,0,1 "crate" 0,90,10 1,0,1 "ladder" 0,50,0 0,2,1 "wall" 50,20,0 7,0,1 "building" 0,10,0

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

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Editor split scene 1 Answer

How to save a scene while playing? 1 Answer

Anyway to save which seen the player was on, then load that scene back from another one at a different time? 2 Answers

Real Time Multi-Developer Level Editing 0 Answers

save scene to separate multiple scene files 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