Create Your First Godot 4 Game
Lesson 4: Creating the player
Video Notes
Now things are really going to get interesting! In this lesson, you’ll start creating your player character. You’ll also start learning GDScript, Godot’s custom scripting language.
You can learn the GDScript basics on the Godot website.
Corrections
In Godot 4 Beta 16 or higher, the AnimatedSprite2D’s Playing checkbox has been removed from the Inspector. It has been replaced by the Autoplay button, which can be found in SpriteFrames panel next to the trashcan icon.
Some versions of Godot 4 don’t have the “Listen for Input” option when setting up keybindings. In that case, just use the manual option.
Notes
- Use the “Select/Clear All Frames” button as quick way to select all the frames in a sprite sheet
- If your Player is not showing up in the World scene, make sure your Player scene is saved first
- When getting a reference to the
AnimatedSprite2D
and theCamera2D
, pay attention to the case of the names in the scene. Yours could be different than the ones shown in the video.
If you get stuck, you can compare your code to ours here: https://github.com/quiver-dev/raptor-run. If you’re still stuck, leave a comment here.
Lessons
- Lesson 1: Getting started with Godot 4
- Lesson 2: Overview of the Godot interface
- Lesson 3: Setting up the level
- Lesson 4: Creating the player
- Lesson 5: Spawning the platforms
- Lesson 6: Creating a collectible
- Lesson 7: Creating an enemy
- Lesson 8: Handling player death
- Lesson 9: Creating the player projectile
- Lesson 10: Adding the final touches
- Lesson 11: Exporting your game and wrapping up