Public Static Variable Not Updating in other scripts
in script A, I define a variable
public static string fooC;
, I update it in a function,
and then I try to access it in another script,
but the variable is just at the default "RPCname", im sorry if this is really bad formating, im new to asking with help, and i can't find anything on google to help me. I don't know if this breaks OOP or not15 Replies
where did u access the fooC ?
I accessed it from another script
its like
creating a new field i think?
Im thinking that when the other script asks for fooC it's too early
was it this part?
yea
sorry about my code, I still have lots to learn about readability
it is probably too early
just re-create a new discord obj
i could probably make a while loop or something untill the value is not null, but that might cause a whole lot of stuff
do you want State is the sceneName ?
what could that do?
no, i mean do want the Discord State is equal to the scene name?
yea
maybe just create static function to get new RPC loader
oh yea, good idea
or rather than creating a new one
get the stored RPC Loader reference, but set the State from a parameter
Thanks a bunch @Steak ! I think i figured it out
Im just gonna run a test in a moment to see
Fixed! Thanks :)