Search Unity

Play Mode Save

Discussion in 'Assets and Asset Store' started by pluginmaster418, Aug 20, 2020.

  1. pluginmaster418

    pluginmaster418

    Joined:
    Jun 6, 2020
    Posts:
    189
    Hi, thanks for reporting the bug. I'll let you know when it's fixed.
     
    vincurekf likes this.
  2. pluginmaster418

    pluginmaster418

    Joined:
    Jun 6, 2020
    Posts:
    189
  3. justifun

    justifun

    Joined:
    Apr 2, 2013
    Posts:
    22
    I can't see to get the right click menu to come up. In play mode (in the game scene nothing happens) and in scene view i get right click view navigation instead. is there a setting i need to adjust in the editor or something? thx

    edit: You need to click the component of the object you want to save unless you have "auto save all" options selected in the save play mode inspector
     
  4. pluginmaster418

    pluginmaster418

    Joined:
    Jun 6, 2020
    Posts:
    189
    To display the context menu, simply right-click the component in the inspector.
     
  5. rizorpolder

    rizorpolder

    Joined:
    Feb 20, 2019
    Posts:
    5
    Good idea and good start!
    Have some questions:
    1) Wht about saving across scenes? I have "Scene 1", whitch loading "Scene 2", and i need to save changes on "Scene 2". Saving on exiting playmode isnt works, Save now - same, but when exired from playmode - both of scenes are loaded (but components has no chanded) - is it will be fixed?
    2) How its will be works with prefabs? Nested prefabs? Asset will save "Scene", or apply changes on prefab?
    P.S. No, i cant use playmode on "Scene 2", coz basic logic initializing on Scene 1.
     
  6. pluginmaster418

    pluginmaster418

    Joined:
    Jun 6, 2020
    Posts:
    189
    Hi, Have you enabled the auto-apply option?
    I have tried but here it works fine.
    Could you send me a mockup project where I can test the issue? my email is pluginmaster418@gmail.com

    The tool does not apply overrides on prefabs.
    For prefabs created in edit mode. Changes made in play mode will be applied to the object in the same way as if you had made them by hand using the inspector in edit mode.
    For prefabs instantiated in Play mode, the tool will treat them as independent objects, disconnected from the original prefab.

    If you want to modify and apply overrides to prefabs instances instantiated in play mode, you can change your instantiation code like this:
    Code (CSharp):
    1. #if UNITY_EDITOR
    2.    UnityEditor.PrefabUtility.InstantiatePrefab(prefab);
    3. #else
    4.    Instantiate(prefab);
    5. #endif
     
  7. xiao-xxl

    xiao-xxl

    Joined:
    Nov 16, 2018
    Posts:
    48
    Doesn't work for SerializeReference. Can you solve it?
     
  8. pluginmaster418

    pluginmaster418

    Joined:
    Jun 6, 2020
    Posts:
    189
    Hi, Thanks for reporting the issue. I'll try to fix it. Could you send me a mockup project or package where I can test the issue? my email is pluginmaster418@gmail.com.
     
  9. xiao-xxl

    xiao-xxl

    Joined:
    Nov 16, 2018
    Posts:
    48
    In my project it doesn't work, but I tried a minimal demo and it's ok. So, the problem might be in my project, let me test it a little more and let you know the result.

    I've tested many times, but still can't find a specific problem. But it really doesn't work in my project and often crashes Unity.
     
    Last edited: Feb 11, 2022
  10. Holooooo

    Holooooo

    Joined:
    Apr 17, 2020
    Posts:
    1
    Great job!But it seems doesnt work in 20.3.30f1.I try to save Main Camera transform, but it turn back to old value after me exit play mode.
     
  11. pluginmaster418

    pluginmaster418

    Joined:
    Jun 6, 2020
    Posts:
    189
    Hi, thanks for reporting the issue, I tried here and it works on unity 2020.3.30f1.
    Could you describe the sequence of steps you followed before the problem occurred?
    Or, could you record a video showing the issue?
     
  12. Stonegolemstudio

    Stonegolemstudio

    Joined:
    Feb 26, 2022
    Posts:
    13
    Is there a new documentation anywhere?
     
  13. pluginmaster418

    pluginmaster418

    Joined:
    Jun 6, 2020
    Posts:
    189
  14. pholz

    pholz

    Joined:
    Feb 27, 2014
    Posts:
    5
    Hi,

    I just sent a mail but maybe some others have the same issue: When I save a script component, all object references are deleted. Also, it sometimes just doesn't work at all. 2022.2b6. It may have to do with the fact that I am dynamically unloading and loading scenes after startup...?
     
  15. pluginmaster418

    pluginmaster418

    Joined:
    Jun 6, 2020
    Posts:
    189
    Hi. Thank you for reporting the issue. I'll let you know when it's fixed.
     
  16. Game_Taco

    Game_Taco

    Joined:
    Jun 16, 2018
    Posts:
    3
    Hey @pluginmaster418 I’m considering picking this up, but I’m wondering about the limitation in the documentation. Is this limited by the Unity serialization utility, or is it able to work with something more advanced? I often use Odin’s serializer or the Json.net serializer because they support generics and more complicated types, and they're both free.
     
  17. pluginmaster418

    pluginmaster418

    Joined:
    Jun 6, 2020
    Posts:
    189
    Hi, Play Mode Save uses Unity's serialization system, so there is no support for generics or more complicated types.
     
  18. tomkail_betterup

    tomkail_betterup

    Joined:
    Nov 17, 2021
    Posts:
    106
    Just bought this plugin - it seems to work great and it's a bargain for the price (try implementing this yourself, it ain't simple!), but I'd assumed it would restore gameobjects, not just component values.
    For those who need this functionality, I wrote a plugin while at Inkle that's free to use. It's a bit scrappy but works in simple cases. Surprised to find that Unity still haven't solved this officially all these years later :(
    https://github.com/inkle/Unity-Save-Play-Mode-Changes
     
  19. pluginmaster418

    pluginmaster418

    Joined:
    Jun 6, 2020
    Posts:
    189
    Hi. You can save objects created in play mode by selecting the object and then in the PMS window selecting "Save all components now" or "Save all components when exiting play mode". Another way to restore new objects created in play mode is to create a parent for the new objects and then add it to the save list by selecting "Always save all components when exiting play mode" in the PMS window.
     
  20. FredTuna

    FredTuna

    Joined:
    Dec 28, 2016
    Posts:
    16
    Hi @pluginmaster418 , I just purchased and installed PMS but realized it might not work for my use case. Our scene is pretty bare to start with and we instantiate most of the world's objects at runtime by instantiating prefabs. Unfortunately, PMS doesn't seem to work when modifying values on objects from instantiated prefabs? Is this correct? If so, is it something that could be added as a feature in the future?

    What I'd love is for PMS to detect that when I modify a property on a component that is part of an object of an instantiated prefab, it recognizes which prefab it is an instance of and apply the changes to that prefab.
     
  21. pluginmaster418

    pluginmaster418

    Joined:
    Jun 6, 2020
    Posts:
    189
    Hi, PMS doesn't apply overrides on prefabs.
    If you want to modify and apply overrides to prefabs instances instantiated in play mode, you can change your instantiation code like this:
    Code (CSharp):
    1. #if UNITY_EDITOR
    2.    UnityEditor.PrefabUtility.InstantiatePrefab(prefab);
    3. #else
    4.    Instantiate(prefab);
    5. #endif
     
  22. WayneJP

    WayneJP

    Joined:
    Jun 28, 2019
    Posts:
    44
    Got a problem. I have scene A and scene B, I save changes on scene B, then move player to transition to scene A.
    If I back to scene B, the changes on scene B are discarded.
    If I exit the play mode, changes in scene B don't save, and if I click Apply All Changes, the gameObjects I changed in scene B are all dissapear !
     
  23. pluginmaster418

    pluginmaster418

    Joined:
    Jun 6, 2020
    Posts:
    189
    Hi, thanks for reporting the issue. I'll let you know when it's fixed.
     
  24. pluginmaster418

    pluginmaster418

    Joined:
    Jun 6, 2020
    Posts:
    189
    Fixed in version 3.7.5. Now available to download.
     
  25. WayneJP

    WayneJP

    Joined:
    Jun 28, 2019
    Posts:
    44
    It works fine, though transition through scenes will revert all changes, but the plugin save and apply changes correctly after exiting the play mode.
    Not sure if that's a issue. It's up to you :)
     
  26. jderricorbc

    jderricorbc

    Joined:
    Jan 24, 2023
    Posts:
    1
    Hello, I am currently getting a compile error when trying to enter play mode after installing this. Any thoughts on how to resolve this? Thank you.

    Assets\PluginMaster\PlayModeSave\Editor\Scripts\PlayModeSave.cs(936,47): error CS1061: 'Cinemachine3rdPersonFollow' does not contain a definition for 'DampingIntoCollision' and no accessible extension method 'DampingIntoCollision' accepting a first argument of type 'Cinemachine3rdPersonFollow' could be found (are you missing a using directive or an assembly reference?)
     
  27. pluginmaster418

    pluginmaster418

    Joined:
    Jun 6, 2020
    Posts:
    189
    Hi, thanks for reporting the issue. What version of Unity are you using?
    A quick fix is to delete all lines containing 'DampingIntoCollision' and 'DampingFromCollision'.
    I'll include the fix in the next version.
     
    Last edited: Jan 28, 2023
  28. Hiti3

    Hiti3

    Joined:
    Jul 16, 2015
    Posts:
    11
    Hey, I noticed the script while searching for an asset. Can this tool save the entire scene (a city - objects with meshes and a texture on it) into an object or a prefab that can then be loaded in any scene in editor?

    I was looking into FBX exporter to save the whole scene with all the gameObjects, because the scene is procedurally generated and I wish to save this procedurally generated scene to later load and edit it manually in editor. Can it do that and what would the simplest way to go about doing this?
     
  29. cihadturhan_unity

    cihadturhan_unity

    Joined:
    Apr 19, 2021
    Posts:
    66
    Just a heads up.
    This is not an error but just a warning from unity 2022.3.2f1. I guess some APIs changed in this unity version.
    upload_2023-7-19_1-34-36.png
     
  30. pluginmaster418

    pluginmaster418

    Joined:
    Jun 6, 2020
    Posts:
    189
    Hi. Thanks for reporting the issue.
     
    cihadturhan_unity likes this.
  31. cihadturhan_unity

    cihadturhan_unity

    Joined:
    Apr 19, 2021
    Posts:
    66
    @pluginmaster418 This asset stopped working.
    It somehow adds `null` value to `_scenesToOpen` array and it fails to save on exit.

    upload_2023-10-8_17-13-30.png
     
  32. cihadturhan_unity

    cihadturhan_unity

    Joined:
    Apr 19, 2021
    Posts:
    66
    On top of this, where can I see the list of all the items being saved. Is there an UI for that?
     
  33. BradleyHean1

    BradleyHean1

    Joined:
    Apr 27, 2015
    Posts:
    4
    HI, a quick question. If I load a scene from an asset bundle (at runtime obviously), will I be able to keep all the gameobjects created after exiting play mode?
     
  34. smallville7123

    smallville7123

    Joined:
    Nov 30, 2018
    Posts:
    35
    Last edited: Jan 3, 2024
  35. Slashbot64

    Slashbot64

    Joined:
    Jun 15, 2020
    Posts:
    326
    I really miss this plugin https://assetstore.unity.com/packag...py-n-paste-multiple-components-50686#releases ...wondering if your one could add some of those features like the other window that shows copied components.. it was way more useful to make a copy of a component during play with changes, and then out of playmode go through and copy the values i wanted permanently keeping....


    not sure if your one can do that where you can save individual fields to be saved after playmode?

    either way the above plugin had benefit of just more ui to look over changed values and decide... could you improve this one to have similar features as seem pretty closely related.. other author abandon gone can't seem to find anything simimlar