PlayState vars require "PlayState." before them in song scripts #566
-
I have a song script |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Playstate.instance.difficulty |
Beta Was this translation helpful? Give feedback.
-
You gotta place everytime you get variables in song scripts for example if you dont specify where they're from (for example like Although NOT every variable is static, remember that |
Beta Was this translation helpful? Give feedback.
You gotta place
PlayState.
before the variable names because those variables are staticeverytime you wanna access a static variable in a script from somewhere in the code (excluded scripts) you always gotta do it (in this case with PlayState)
you can see which variables are static either in the api or in the actual code
everytime you get variables in song scripts for example if you dont specify where they're from (for example like
PlayState.SONG
you're specifying that its from PlayState) it defaults toPlayState.instance.yourVariable
Thats because scripts parents are the class' instance and so everything it tries to get from the outside it defaults to either that or inside the script UNL…