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 BuildIntoGames · Aug 16, 2013 at 06:36 PM · instantiateclonesave scenegame save

How could I save all cloned objects in a scene, and load them back up on start?

I've been having trouble figuring out this for weeks now. Lets say I enter a scene and instantiate a block and then leave the scene. How could I make it to where whenever I re-enter the scene, the block i placed earlier will be cloned into the game in the same position?

Please help! :(

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
0
Best Answer

Answer by ZeroSumGames · Aug 16, 2013 at 06:41 PM

Well there are a few ways to do this. I think what you're basically looking for is save game functionality. You can save your scene into XML as an abstracted representation.

So let's say you have a block. You define a block in XML like

 <BlockList>
    <Block>
       <X>1</X>
       <Y>0</Y>
       <Z>2</Z>
    </Block>
 </BlockList>

So you would need a class that defines a Block with an X, Y, Z position. You also need a class that can write this data to XML and read it back again. Then when you open your level, you read your XML file and instantiate the blocks where you want them to be.

Comment
Add comment · Show 4 · 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 BuildIntoGames · Aug 16, 2013 at 06:45 PM 0
Share

I'm a noob with Unity, for I only got it a few weeks ago... Could you give me a example on how to do this? Once again, I'm pretty new to the unity environment.

avatar image BuildIntoGames · Aug 16, 2013 at 07:00 PM 0
Share

Please help... :((((

avatar image ZeroSumGames · Aug 16, 2013 at 07:05 PM 0
Share

Read this thoroughly. I understand being new at this. The best thing you can learn right now is which questions to ask, which you're doing just fine at. But once you know, ask google first;)

The concept you are after is X$$anonymous$$L Serialization http://wiki.unity3d.com/index.php?title=Saving_and_Loading_Data:_XmlSerializer

avatar image BuildIntoGames · Aug 16, 2013 at 07:09 PM 0
Share

Very confusing, But sounds great! Thanks!

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

16 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

Related Questions

Instantiate Reference Problem 1 Answer

Cloning Objects with Instantiate() - variables/references for added Components not stored? 3 Answers

How to Parent a Cloned Object to Another Cloned Object 1 Answer

Instantiate Clones Itself - Rather than Prefab 0 Answers

Destroy a specific instantiated clone? 2 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