• 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 Moltvatch · Feb 15, 2011 at 09:31 PM · buttongamemultiplerewind

How to save a multpile choice?

Im going to make this simple.

I've made a multiple choice button here it is :

-Function Update () { print ("Hello") } -Function OnGUI() if (GUI.Button(Rect(20,40,100,40),'Hello')) { var answer1=print ("How are you?"); answer1.rendrer.enabled=true;

}}

-Function OnGUI() if (GUI.Button(Rect(20,60,100,40),'sorry I haven't got time')) { var answer1=print ("ok, bye."); answer1.rendrer.enabled=true;

}}

Ok before any comment shows up, I'm aware that my script is wrong. (and if someone can correct it, I thank him for that, it'll be of great help)

But that is not what I want know.

I just want to know how is it possible to save this "function" or choice?

I mean I want to make a rewind button, in the game, that will allow player to come back to another choice option he already made.

Like a save game.

I'm taking this idea from this game: http://ded.increpare.com/~locus/Detective_Clean/

Try it, and try the rewind button you'll understand what I mean.

I want to know how I can save this multiple choice as per exemple "choice 1" and get back to it if i choose in the game to rewind to choice 1.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Unamine · Feb 15, 2011 at 09:42 PM

Actually the script is wrong, do not know if the logic, but look at the: rendrer, the renderer would be correct.

You can use PlayerPrefs to record a variable the value of something, look in your manual offline. Go to Help Menu in Unity > Unity Manual, Scripting and choose Scripting and type PlayerPrefs but also look at the videos of Zerg Burg Arcade:

  1. Unity3D Tutorial - PlayerPrefs 1 / x
  2. Unity3D Tutorial - PlayerPrefs 2 / x
  3. Unity3D Tutorial - PlayerPrefs 3 / x
  4. Unity3D Tutorial - PlayerPrefs 4 / x
  5. Unity3D Tutorial - PlayerPrefs 5 / x
  6. Unity3D Tutorial - PlayerPrefs 6 / x

Link to site: http://www.burgzergarcade.com/hack-slash-rpg-unity3d-game-engine-tutorial

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 Moltvatch · Feb 15, 2011 at 10:03 PM 0
Share

ok i will try.

And i know that the script is wrong, its just to show an exemple.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

How to get script components in multiple gameobjects C# 2 Answers

Game States, communication through scenes and objects 1 Answer

Multiple functions in a single button not working 1 Answer

Action executed with more than one key? 1 Answer

Pause Button Menu loader 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