onStateSwitch getting called twice??? #794
Answered
by
r6915ee
THEkatinamicrowave
asked this question in
Q&A
-
I don't know how to explain this, so I'll just upload this video. There's no duplicate scripts and this is the only time this function is referenced 2025-10-15.21-10-05.mp4Why please help |
Beta Was this translation helpful? Give feedback.
Answered by
r6915ee
Oct 16, 2025
Replies: 1 comment 4 replies
-
This is likely because you are using a state extension, as Shouldn't you be able to override the music when the state is being destroyed? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In that case, you can maybe use the same function contents in a global script, but instead use the
preStateSwitch
callback to catch the event and only use theswitch
statement ifFlxG.state
's type matchesfunkin.menus.MainMenuState
to allow what you are trying to do in the code from the video.