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 sharsnik · Nov 27, 2011 at 12:30 AM · playmodeundo

Undo in playmode

Hi, I've gotten undo to work just fine with RegisterUndo.

However, when I enter playmode, RegisterUndo no longer seems to work.. is that what's supposed to happen? And if so, is there a work around?

Comment
Add comment · Show 1
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 · Nov 27, 2011 at 01:20 AM 0
Share

RegisterUndo is a function for working with the undo functionality in the Editor! You'll need to write your own Undo system if you want it to work in game.

1 Reply

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

Answer by Julien-Lynge · Nov 27, 2011 at 01:58 AM

Sharsnik, There is no 'undo' functionality within the Unity editor's runtime environment, nor are most changes you make there saved - once you hit play, Unity changes to more of a sandbox mode.

If you don't like this sandbox mode and think Unity should change it, there are entries on the Unity wishlist asking for it to be changed, though I don't know of any specifically asking to add an undo functionality to the runtime. My guess is that you'd get some support suggesting it as a feature - my team has definitely been annoyed by it now and then.

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 syclamoth · Nov 27, 2011 at 03:37 AM 0
Share

I disagree about persistant changes in the editor's runtime- It's quite common for events in game (be they bugs or genuine behaviur) that make significant changes to the environment, and it would be a source of unending frustration if you had to reset everything by hand. For example, if I have a pristine world filled with stacked rigidbodies that the player then runs through and completely wrecks, it would take hours fixing it without special code for saving the initial state of every object in the scene at the start.

Having an undo function specifically for changes that the user makes in the inspector would be useful, but since at runtime the game itself can make sudden and unexpected changes, how does the editor know that it is setting things back to the 'correct' value when you hit undo? I think allowing the functionality at runtime would cause more trouble than good.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How to use undo in game mode, 0 Answers

Why is play mode reverting my scriptableobject to a previous serialized state? 2 Answers

Why is unity crashing on "Play mode" 1 Answer

How to undo AssetDatabase.CreateAsset? 0 Answers

How to clear Undo-history for the target of a serializedObject? 0 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