When i load level after another level the level that i loaded didnt work.
Some more information would be helpful, this could be caused by a number of things.
- Maybe you havenât sent
enable
to the loaded collection? - Maybe you havenât sent
disable
to the previous collection and its displaying on top of it?
Itâs a little tough to tell from just this code. Could you also post the code where you post the âfrom_game_to_cutscene
â message to loader.script? (thatâs a bit of an odd message_id to use for switching levels but to each their own )
Aside: Have you tried just sticking a few print
calls here and there? just to see which branches are firing and which arenât? Thatâs what I usually do in these situations.
I suspect if your first level is staying loaded it means it never making it into the if message.world == hash("level_beginner_1")
branch, which would suggest that your post is malformed.
Also. For future reference, you can copy and paste code into your posts, if you wrap them in
```lua
your code goes here
it will come out nicely formatted.
I agree with what @NSCharles wrote. Itâs hard to tell whatâs wrong just by looking at the code youâve posted. Add some print() calls to help you understand what code is being executed and why.
I resolved this problem but this is unusual solution. I created âtransition.collectionâ and after level_1 firstly i load transition and after load level_2.