Giving user a choice to select a character

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By kb_gamer

Hello All,

I am a newbie to game development and Godot. I wanted to understand the best approach to give a game player the ability to choose the character. As an example, before the actual platformer game starts, the user will get to see 3 characters and a user chooses 1 of them. Once the character is chosen, the user will move to play the game using that chosen character.

Thank you in advance and looking forward to being part of the Godot community :slight_smile:

:bust_in_silhouette: Reply From: Inces

This calls for the same sollution as setting difficulty level, choosing stage and so on. Generally You need to design your scene tree structure in a way, that there is some menaging or data-keeping structure above the actual platformer and everything else. In project runtime You will find yourself changing scenes, returning to menus, showing victory/gameover screens and so on. Because of this it is impossible to keep all the data in platformer itself, higher scope variables will be needed. You can use Autoload for this, or customly made node, that will be root of your scene.
How it works will be : choose character in menu → go to character selection menu-> clicked character data is passed from selection menu to Autoload/root-> start the game ->when level loads it reads character data from Autoload/root → done