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
0
Question by Deeeds · Jun 10, 2019 at 11:23 AM · save dataload scenelevel-design

Create Level save files from runtime Level Edits

Level Editing & Save in Play Mode?



During gameplay, (PlayMode in the Editor), the player (daughter) can move and add a few types of objects (prefabs) around in the level, in a sort of very primitive level editing, until she's happy with it.

How do I save these changes and additions she's made, during gameplay, in such a way that I can then load a daughter level within the editor and therein turn it into an actual level?

Can this same mechanism be used to help real world players edit, save and share levels?

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by SneakyLeprechaun · Jun 10, 2019 at 05:30 PM

Here is a great tutorial on saving and loading data from a file. It's more focused on player stats, however it could easily be converted into a level saver, by simply changing the PlayerData to store a list of the object types and positions. This could be done by having all the game objects that you want to save have a tag 'saveable', and then when you run the save function, get the positions and rotations etc of the objects and save them to an array (in terms of what the object actually is, I don't think you can just store a non-primitive, which means you will probably have to come up with a way around that; maybe by making up a list of all the objects and using a numerical id along with it.

Overall it is a complex thing to do, but it is totally possible, and would be even better if you can make it in game.

Link to the helpful tutorial: https://www.youtube.com/watch?v=XOjd_qU2Ido

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 Deeeds · Jun 11, 2019 at 10:48 AM 0
Share

THAN$$anonymous$$ YOU!!! I was in need of a starting point, for a mental model, so to speak, of how to do it.

This might be just the treat. Gotta save just position and rotation of the few game object types that can be moved around and added.

Based on this, and correct me if I'm wrong, I think I can make an array of transforms (I don't need the scale, but just so it's easy) for each type, and pair an ID to each based on Left/Right and UpDown position in the level, used as the index... perhaps. This is where I'm a little confused. This should be sorted on save, I suppose, based on left to right, with up/down as the deter$$anonymous$$ant of ID for any two objects at the same x position.

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

108 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 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 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 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 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

password-based checkpoints 0 Answers

Which is the correct way to save character preferences like clothes? 1 Answer

Save and Load Instantiate Enemies 2 Answers

Sharing violation on path... Save Game Issue. 1 Answer

Chest contents persistence between scenes 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