IT lexicon › Programming › ScriptableObject

ScriptableObject

Programming På svenska → Updated: 2026-10-26

Unity's class for data that lives as its own file in the project rather than as a component on a game object.

A regular Unity component has to sit on a GameObject in a scene. A ScriptableObject is a standalone asset: you subclass it, tag it with [CreateAssetMenu], and create instances as .asset files in the editor. Weapon stats, enemy types and dialogue trees become data that designers can edit without opening a scene, and that a thousand objects can reference without copying.

Ryan Hipple's Unite 2017 talk popularised the approach for event channels and shared variables as well. The trap is that changes made in play mode inside the editor are saved permanently to the asset file — but not in a built game, where the same code behaves differently.

← Back to the lexicon