Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be 📖

Input buffer

An asset by drkitt
The page banner background of a mountain and forest
Input buffer hero image

Quick Information

0 ratings
Input buffer icon image
drkitt
Input buffer

Keeps track of recent inputs in order to make timing windows more flexible. Especially useful for fighting games or similar games that would otherwise require frame-perfect input. The project in the asset's repository is a replica of the Google Chrome dino game made as a demo for the input buffer.To use, copy the file used for your preferred language (input_buffer.gd for GDScript or InputBuffer.cs for C#) into your project and call InputBuffer.is_action_press_buffered where you'd usually call Input.is_action_just_pressed (or for C#, call InputBuffer.IsActionPressBuffered where you'd usually call Input.IsActionJustPressed).

Supported Engine Version
3.5
Version String
1.0
License Version
MIT
Support Level
community
Modified Date
2 years ago
Git URL
Issue URL

Godot input buffer

More responsive input in Godot

Ever had a game ignore your input because you pressed the button a millisecond too early? This project fixes that problem by implementing an input buffer, which stores inputs for a short window of time so their associated actions can be executed in the next possible frame. It's easy to add it to any project, supports keyboard and controller input, and works with both GDScript and C#. Your players won't know it's there, but they'll feel it!

Usage

GDScript

  1. Put a copy of the input_buffer.gd file into your project. You can clone the repository, download a ZIP of it, or simply copy and paste the file's contents into a new file, whatever works for you. Once you have the file, move it into anywhere in your project folder.
  2. Add the input_buffer.gd script to your project's AutoLoad settings. More information on how to do that can be found here.
  3. That's all the setup you need! To use it in your game, just call InputBuffer.is_action_press_buffered where you'd usually call Input.is_action_just_pressed

C#

Same process as the GDScript version, except the file is called InputBuffer.cs. Download the file, add it to your project as an AutoLoad script, and call InputBuffer.IsActionPressBuffered where you'd usually call Input.IsActionJustPressed.

Demo

README Demo screenshot

I made a replica of the Google Chrome dino game to test the input buffer (and practice a few other things, like saving & loading data and working with Godot's UI features). It's included in this repository if you want to try it out. Note that it's made in C#, so you'll need the Mono SDK and the Mono version of Godot. Press the spacebar to jump and press the escape key to toggle the input buffer on and off. You may notice it's easier to quickly jump up and down when the buffer is on.

Keeps track of recent inputs in order to make timing windows more flexible. Especially useful for fighting games or similar games that would otherwise require frame-perfect input. The project in the asset's repository is a replica of the Google Chrome dino game made as a demo for the input buffer.

To use, copy the file used for your preferred language (input_buffer.gd for GDScript or InputBuffer.cs for C#) into your project and call InputBuffer.is_action_press_buffered where you'd usually call Input.is_action_just_pressed (or for C#, call InputBuffer.IsActionPressBuffered where you'd usually call Input.IsActionJustPressed).

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Input buffer icon image
drkitt
Input buffer

Keeps track of recent inputs in order to make timing windows more flexible. Especially useful for fighting games or similar games that would otherwise require frame-perfect input. The project in the asset's repository is a replica of the Google Chrome dino game made as a demo for the input buffer.To use, copy the file used for your preferred language (input_buffer.gd for GDScript or InputBuffer.cs for C#) into your project and call InputBuffer.is_action_press_buffered where you'd usually call Input.is_action_just_pressed (or for C#, call InputBuffer.IsActionPressBuffered where you'd usually call Input.IsActionJustPressed).

Supported Engine Version
3.5
Version String
1.0
License Version
MIT
Support Level
community
Modified Date
2 years ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers