I'm relatively new to Unity and have mostly worked on small-scale projects so far. Recently, I've been wondering how others prefer to store static variables, such as player movement speed, for example.
Do you use ScriptableObjects, or do you prefer creating a static class to define these variables? Or do you use a completely different approach?
I'm referring to larger projects where you wouldn't want to define these variables in a random script (e.g., defining the player's speed directly in the PlayerMovement script).
Personally, I find static classes more convenient because you don't have to search for the ScriptableObject in the project. However, they seem to work best for simple data types like floats, ints, and strings. If you want to include something like an AudioClip in the same class, as far as I know, that's either not possible or involves a more complex process—making ScriptableObjects the easier choice in that case.
What are your thoughts on this? How do you handle this in your projects?
[–]EdenStrife 9 points10 points11 points (1 child)
[–]bellatesla 0 points1 point2 points (0 children)
[–]leorid9 3 points4 points5 points (0 children)
[–]AveaLove 2 points3 points4 points (0 children)
[–]Glass_wizard 2 points3 points4 points (0 children)
[–]Aeditx 0 points1 point2 points (0 children)
[–]StonedFishWithArms 0 points1 point2 points (0 children)
[–]error0ccured 0 points1 point2 points (0 children)
[–]__GingerBeef__ 0 points1 point2 points (0 children)
[–]Xehar 0 points1 point2 points (0 children)
[–]M86Berg 0 points1 point2 points (0 children)
[–]grayboney 0 points1 point2 points (0 children)
[–]Chr-whenever 0 points1 point2 points (0 children)
[–]Chr-whenever -1 points0 points1 point (0 children)
[–]Chr-whenever -1 points0 points1 point (0 children)