Camera viewport changes don't reset when exiting Play mode

I have a runtime script that changes a camera viewport based on orientation and SafeArea. When I exit Play Mode, the editor settings for that camera are locked to the last value at runtime. I expected that those values would return to the defaults (prior to entering Play Mode).

The script has the ExecuteInEditMode attribute, which is probably the issue here.

Is there a way to know when you’re exiting Play Mode so that I could have the same scripts perform the reset?

Try OnApplicationQuit

1 Like

Thanks Joe. If I could close or mark the thread solved, I would!

I think most people just add [SOLVED] to the title, or just leave it be.