How can I make a multi-character system in Godot 2D?

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

Hello, I would like to know how to make a multi-character system (so you can play with more than 1 playable character) in Godot 2D.

Thanks in advance.

Are you going for multiple characters controlled by different keys/controllers or a system to switch the character but always play with the same keys/controller?

Jowan-Spooner | 2019-06-03 07:42

A system to switch between characters, much like GTA 5

ZeraPlay | 2019-06-03 11:23

:bust_in_silhouette: Reply From: Thomas Karcher

For multiplayer online games, have a look at the demo projects provided in

For games with two players sharing one screen, I’d recommend the splitscreen demo by KidsCanCode:

If you want one player to switch between different characters, you can simply define different controls for the characters (WASD for one, cursor keys for the other), or implement a switching mechanism, e.g. update an “active_character” variable every time a character is selected with a mouse click, space key, tab key…

Could you explain more about the switching mechanism with active_character!

pkx | 2020-11-24 18:59

What exactly do you want to know? You basically track the active player node with a variable and assign the camera and movement commands accordingly. Here’s a quick demo:

GitHub - t-karcher/Player-Switch-Demo: Simple mechanism for switching controls between multiple characters / players in game, implemented with GDScript in the Godot Engine.

Let me know if you have any specific questions.

Thomas Karcher | 2020-11-25 14:37