Member-only story
Implementing a simple 2D character controller (Godot 4/C#)
Let’s create our own 2D avatar using physics & scripting!

You know, all those little 2D games where you control a little avatar that’s jumping around and running on platforms? Well, today, we’re going to see how to create such a basic 2D character controller in Godot 4 and C# :)
By the end of this tutorial, you’ll know how to setup a basic physics-based 2D player movement manager with some collisions with the ground, and even a few walk animations :)

Also, note that for this tutorial, I’ll be using this little 2D level based on tilemaps, and if you’re curious about how to create such a scene, you can check out this previous tutorial to learn the basics of 2D tilemaps in Godot 4:
As usual, don’t forget that you can get the demo scene and all the assets from this demo on my Github 🚀 with all my other Godot tutorials.
The tutorial is also available as a video — text version is below:
And with that said, let’s dive in and discover the fundamentals of making a 2D character controller in Godot!
Setting up the player object
To begin with, let’s discuss the different elements we need in our player object. For this tutorial, I’ll be using the sprites of the Platformer Art pack from Kenney’s amazing library and, in particular, I’m gonna use one of its alien characters for the player visuals: