Change scene from variable


#1

Hi,
I want to change the scene with the name selected from the global variable.
E.g:
I saved the value = 1 in the global variable “SceneName” and of course I already have a scene in my project called 1. In the “menu” scene I have a load game button. After pressing this button, I want the scene to change to the name that is stored in the global variable. I tried using the: change to scene GlobalVariable (SceneName) option, but it doesn’t work.


#2

are you converted the value to string? is te typo and the syntax was correct? may be you can upload a screenshot from the related events.


#3

I tried to do ToString but it still doesn’t work :frowning:


#4

the answer for the original question was correct. you should name your scenes correctly, and than you should convert the variable to string for the expression. this is work for me, I tried:

you should check your save/load and the related variable. but from here it is not a “how do I” question anymore. you should debug your product.


#5

image
Why your ToString is colored by green, and my is not?


#6

I’m using the dark color theme. may be it does the other coloring, I dont know. I never used the default theme.