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 RaysFan · Jul 05, 2012 at 06:15 PM · gamesave

How to make Save Game feature?

I was wondering how can I make a simple save game feature using the Unity GUI? Just a simple save game feature that will save your progress and inventory, stuff like that. Any help would be appreciated! Thanks!

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

6 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by whydoidoit · Jul 05, 2012 at 06:18 PM

It's far from simple to do a save game feature. I have this free package that can help.

If you want to do it yourself you would serialize the information to PlayerPrefs - you can store custom classes using BinaryFormatter or an Xml Serializer and Convert.ToBase64String() or you can just write values directly.

Comment
Add comment · Show 12 · 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 Mortoc · Jul 05, 2012 at 06:21 PM 1
Share

I don't recommend using the built in System.Runtime.Serialization stuff, Unity tends to break it's functionality and can do some really weird stuff with it sometimes (like, if you have a reference to a [Serializable] object from a static object in your code, Unity will instantiate that object against your wishes during the static initialization phase)

avatar image whydoidoit · Jul 05, 2012 at 06:23 PM 0
Share

Yeah good point it does use that internally - actually you can serialize a POCO class (Plain Old CLR Object) without specific Serializable decoration using BinaryFormatter.

avatar image RaysFan · Jul 05, 2012 at 06:48 PM 0
Share

What does your free package do? Does it work to where I can have it save game?

avatar image whydoidoit · Jul 05, 2012 at 06:49 PM 0
Share

Yes that is what it does - there is a video and an explanation in the link I posted in my answer.

avatar image RaysFan · Jul 05, 2012 at 06:53 PM 0
Share

O$$anonymous$$...I downloaded...but yet...I get a "All compiler errors must be fixed" error in Unity. How can I set this program up?

Show more comments
avatar image
0

Answer by Jake Haas · Jul 05, 2012 at 08:40 PM

If you don't want to buy any plugins, player prefs are probably the best way to go.

http://docs.unity3d.com/Documentation/ScriptReference/PlayerPrefs.html

Comment
Add comment · Show 6 · 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 RaysFan · Jul 05, 2012 at 11:38 PM 0
Share

I would like it to save in-game. So they say Player prefs would not be the best choice in game.

avatar image whydoidoit · Jul 06, 2012 at 01:19 AM 0
Share

I should point out you don't need to buy my plug in :)

avatar image RaysFan · Jul 06, 2012 at 01:20 AM 0
Share

I would use your plugin if i could figure out whats wrong with error messages.

avatar image whydoidoit · Jul 06, 2012 at 01:21 AM 0
Share

See comment above - it must conflict with one of your existing classes - but I can't help you with that if I don;t know what the messages are.

avatar image RaysFan · Jul 06, 2012 at 01:26 AM 0
Share

The only error I get is that all compiler errors must be fixed before entering play mode.

Show more comments
avatar image
0

Answer by kurotatsu · Jul 06, 2012 at 03:58 AM

I use PlayerPrefs, and asked a similar question earlier here.

It has a working example of saving a players position. It should help you get an Idea of how to actually impliment the saving and loading by calling the functions in the script.

Hope it helps.(if it works for ya maybe give a brother an upvote, and click the answer checkmark.:))

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
avatar image
0

Answer by RaysFan · Jul 06, 2012 at 01:49 PM

Thanks anyways...I will continue to look around. Thanks for trying to help me out.

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
avatar image
0

Answer by RaysFan · Jul 11, 2012 at 08:50 PM

I am trying to figure out script for playerprefs......am very confused. Any help would be appreciated.

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 kurotatsu · Jul 13, 2012 at 03:28 AM 0
Share

I updated the script in my link to be a drag and drop solution for ya, it should work now.

Don't forget ta vote and check the answer checkmark, so questions don't show up in searches as unanswered.:)

  • 1
  • 2
  • ›

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

9 People are following this question.

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

Related Questions

How to store a boolean for each variable in a class 1 Answer

Unity 3D 2018.1 - Save 0 Answers

load button in main menu 1 Answer

Level creator save bug. 0 Answers

Saving Instantiates in safe file? 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