Back to Writing
NOTESunityscriptable-objectmemory-management

Unity ScriptableObject Memory Management Gotcha

April 30, 2021Updated Feb 17, 2026

Since ScriptableObjects are asset types, I assumed they'd always be loaded in memory at runtime.

However, it turns out that when a scene changes, if nothing in the previous scene held a reference to that ScriptableObject, it gets unloaded from memory.

Ended up solving this by creating a singleton-like instance and storing it in a static variable.