Today's tip is something I learned fairly recently. It turns out that there's a cleaner way to set default values in Unity, rather than hardcoding the values when you declare the variable.
#gamedev #indiedev #unity3d #madewithunity
Today's tip is something I learned fairly recently. It turns out that there's a cleaner way to set default values in Unity, rather than hardcoding the values when you declare the variable. #gamedev #indiedev #unity3d #madewithunity
0 vue
Publié le 25/08/2026 14:28
Today's tip is something I learned fairly recently. It turns out that there's a cleaner way to set default values in Unity, rather than hardcoding the values when you declare the variable.
#gamedev #indiedev #unity3d #madewithunity
1 commentaire
?
Reset() only ever runs in the Editor, never at runtime. The values it sets on serialized fields carry over, even on prefabs you instantiate at runtime, since Unity copies the prefab's already serialized data.
It won't help with private, non serialized fields, or components you add at runtime with AddComponent.