CodeX

Everything connected with Tech & Code. Follow to join our 1M+ monthly readers

Follow publication

Member-only story

Learning the basics of input actions (Godot 4/C#)

Let’s see how to make simple but powerful inputs for our Godot games!

Mina Pêcheux
CodeX
Published in
10 min readOct 9, 2023

Video games are a unique form of art because, among other things, they are an interactive medium. This means that a core feature of any game is handling user inputs, and reacting to the press of keys and buttons to trigger various actions in the game.

And, to do this, a very common technique is to use what we call .

So, in this article, we’ll see why input actions are an interesting tool, how to create custom ones in a Godot project and how to use them in your C# code to trigger some specific actions on-screen.

Also, note that in this tutorial, I’ll be re-using the scene and player setup that we discussed in this previous episode of the series, with a little 2D avatar that can move horizontally or jump:

So be sure to check it out first if you haven’t seen it yet!

As usual, since we’ll be coding our logic in C#, make sure that you have a version of Godot with .NET enabled.

Download a version of Godot with .NET support, to be able to program in C#! :)

And of course, 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:

But now, with all that said, let’s dive in and discover the basics of using input actions in Godot and C#!

So… why use input actions?

Before talking about the how, let’s first quickly discuss the why.

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

CodeX
CodeX

Published in CodeX

Everything connected with Tech & Code. Follow to join our 1M+ monthly readers

Mina Pêcheux
Mina Pêcheux

Written by Mina Pêcheux

I’m a freelance full-stack web & game developer. I’m passionate about topics like CGI, music, data science and more! Find me at: https://minapecheux.com :)

No responses yet

Write a response