copy play mode values to scene

I often find myself fine-tuning things in play mode, when animations are running, etc. Things like the exact positions of objects or the camera position.

I can copy a single component, such as the transform values, exit play mode, paste them.

But isn’t there a better way? Can I while in play mode say “I’m happy with this, copy these component values to the scene object”, i.e. keep them when I exit play mode?

One cheesy way is run the game, tweak and twiddle, press pause and drag the part you want into your project as a temp prefab.

Now stop the game and drag that prefab back into your scene, and break the prefab instance, then delete the prefab, and drag all the bits and pieces you want back into your scene where you want them…

This will let you adjust certain things but not others. You kinda gotta get a feel for it.

Another way is to use ScriptableObjects for certain stuff… the difference is SOs are the same lying around on disk as they are running in the game, whereas MonoBehaviours are fired up and shut down. But yeah, you’d need to make an SO with fields that are “live used” by everything in your game, so in a general sense, eh, not super-easy.

This is very odd. You’d think that such an obvious feature would be built-in or if not there’s be ten solutions on the asset store.

Unity deliberately doesn’t keep the changes only in highly specialized circumstances.

https://assetstore.unity.com/?q=keep%20play%20mode%20changes&orderBy=1

IDK how those assets are, I don’t use any of them.

7203229--865066--screenshot1.png

1 Like

You don’t need a $5 plugin to do this. When you are in play mode, mess with the values on 1 component at a time. Once you have tweaked the values, click the dots at the top right of the specific component, and click “Copy Component”. Exit play mode, and click the dots again on the same component, “Paste Component Values”.

2 Likes

It’s work but only one at a time. We can’t do that when we need to edit many objects