One button but different scenes

Jovial Games

  • Posts: 132
Hey guys,

Currently I have a game where once the level is completed a new button is created, upon tapping, the scene changes to level 2. If I was to make a button for level 3, I'd create another button and do the same.

But then eventually once I get a lot of levels, it'll also have so many buttons..

Is it possible that I create one button which can switch scene to level 2 and then reuse that button for level 3 that switches to level 4 and so on instead of creating individual buttons for each transition?

JeffreyDriver

  • Posts: 2262
Yes. Different ways on doing it. How are your levels titled?

For example if your scenes were named 'Level 1', 'Level 2' and so on you could get the current scene name, split the name into a list to get the number separate and then increment that by one, the save that as a scene name (text)