Search Unity

Feature Request we need a simple check box "Keep editor changes in PlayMode"

Discussion in 'Editor & General Support' started by mfatihbarut, May 19, 2022.

  1. mfatihbarut

    mfatihbarut

    Joined:
    Apr 11, 2018
    Posts:
    1,060
    Hi,
    Sometimes we want to keep the changes we made on a GameObject while in PlayMode.
    It would be nice to have a checkbox for it in the inspector.
     
    Marc-Saubion likes this.
  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,934
    When you enter playmode you're actually entering what is a copy of the scene asset, not the scene asset itself, which is how Unity reverts everything back when you leave play mode.

    Remember that loading a scene, too, really boils down to Unity Instantiate()-ing everything in the scene asset.

    Were Unity able to apply changes in this transient scene you're playing in to the real scene asset, I imagine this feature would have been implemented a long time ago.

    For now, if you want changes to persists between play mode sessions, Scriptable Objects are the way.
     
  3. mfatihbarut

    mfatihbarut

    Joined:
    Apr 11, 2018
    Posts:
    1,060
    there is a free asset in the asset store. Even it solves the problem. But it should be a native feature of Unity.
     
  4. pbritton

    pbritton

    Joined:
    Nov 14, 2016
    Posts:
    160
    You can copy the asset in playmode, then paste it when not in playmode.

    Does not retain prefabs.
     
  5. mfatihbarut

    mfatihbarut

    Joined:
    Apr 11, 2018
    Posts:
    1,060
    not a solution for most of the time. Lots of negative effects.
     
  6. Marc-Saubion

    Marc-Saubion

    Joined:
    Jul 6, 2011
    Posts:
    655
    I remember unity talking about that feature few years ago.

    I wonder why it never came to be.