Search Unity

Request: Way to apply current state of object to its saved scene values

Discussion in 'Editor & General Support' started by SpacePrez, Feb 23, 2021.

  1. SpacePrez

    SpacePrez

    Joined:
    Aug 19, 2019
    Posts:
    7
    This would be very simple and would save countless hours.

    Has this ever happened to you? You run the game inside the Unity editor, you play around with debugging things, changing values for enemy AI or moving an object's position.

    Then you hit stop, and everything reverts back to where it was.

    So what do you do? You hit play, make the changes, and then.... use your cell phone to take a PICTURE of the values in the editor. Then hit stop, then use the picture as a reference to reset the values to what they should be.

    It is absurd that this is necessary. In the same way changes to a prefab have the option to "apply to base", the same should be true of mutable state of GameObject components such as Transform.

    Just give the inspector a right click option to "apply to base scene" and copy the current running component values into the base saved scene values.

    Example of how this would work:

    Press start. Enemies spawn and start moving around with controllers and AI. Shoot some enemies so they die and physics ragdolls them. Then pause the game, select the ragdolls and hit "apply to base scene". Now when you hit start, the enemies stay on the ground in their ragdoll position where you shot them.

    This would be incredibly simple to implement and yet would be INCREDIBLY powerful tool to developers.
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,909
    There's a slightly better way than taking a picture or screenshot.

    On any component in the inspector you can click ionto the little menu at the top right and copy the component:
    upload_2021-2-23_14-17-2.png

    Then after play mode ends, go find that same component and select "Paste Component Values"