By runtime variables I mean temporary variables that can be edited on runtime without changing Scriptable Object’s original values. Think object states, player HP, etc. My project has it so that you can set scriptable object values through a custom inspector in the editor, and these values would be used and edited on runtime.
I’m honestly stumped on how to do this. I’ve tried instantiating each SO on start but that created a whole slew of issues like not being able to grab objects by reference and instead having to search for their copy. I’ve thought of copying every single variable in said object on Awake, but I’m not sure that’s viable.
What’s the best way to go about this? I’ve searched long and hard on ways to keep original SO values in runtime but I haven’t found any good ways to do it.
,By runtime values I mean variables that temporarily store data at runtime so the original variables of the SO aren’t permanently changed even after I close the game. The data gets edited on runtime
What I’m currently doing is straight up instantiating the object and storing that instead, but this causes a whole slew of issues like not being able to reference the object directly and having to search for its copy.
I’m wondering if it’s a viable idea to make a copy of EVERY SINGLE VARIABLE and initializing them in Awake(). I’m honestly stumped because all solutions for this involve a lot of effort and messy code.
What’s a good way to use SOs where its values change on runtime? I’m looking for any workarounds or ideas in general.