Saving in Play Mode | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Saving in Play Mode

    It’s often most convenient to adjust camera settings while the game is playing. But normally, Unity does not save your changes to the Scene when you exit Play Mode. Cinemachine has a special feature to preserve the tweaks you make during Play Mode. It doesn’t save structural changes, like adding or removing a behavior. With the exception of certain properties, Cinemachine preserves most of the settings in your Virtual Cameras when you exit Play Mode.

    When you exit Play Mode, Cinemachine scans the Scene to collect any changed properties in the Virtual Cameras. Cinemachine saves these changes a second or so after exiting. Use the Edit > Undo command to revert these changes.

    Check Save During Play on any Virtual Camera in the Inspector to enable this feature. This is a global property, not per-camera, so you only need to check or uncheck it once.

    Cinemachine components have the special attribute [SaveDuringPlay] to enable this functionality. Feel free to use it on classes within your own custom scripts too if you need it. To exclude a field in a class with the [SaveDuringPlay] attribute, add the [NoSaveDuringPlay] attribute to the field.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie 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.
    Generated by DocFX on 18 October 2023