[Custom Condition] Baz Input Condition

BazInputCondition

Analog-aware input condition for GameObjects. Reads joypad sticks, triggers, and deadzones, plus input buffering that carries across states so jump-buffering just works. Three modes, one file, no autoload, no plugin, no Project Settings changes.

To help support my work, consider becoming a patron. :folded_hands:

DOWNLOAD:
v1.2:
BazInputCondition.gd (32.1 KB)

:warning: This update will break any previous BazInputCondition resources. It is a necessary design change due to the nature of AGM input. If you find the previous versions not playing well during a local multiplayer setup, you need this version.

  • Two modes now, Single and Movement. Dropped Stick / Vector. Each direction reads its own key, so stick, keyboard and D pad all behave the same. Smaller file, cleaner inspector.
  • Custom Keys in Movement. The new Source field (MoveAndJumpSetting Keys / Custom Keys) lets you pick your own four keys. Leave one empty to skip that direction.
  • Deadzone Enabled toggle. Off by default so buttons and keys stay 0/1. Turn it on when a stick or trigger drives the input and the Deadzone slider becomes the threshold.
  • All four timings in both modes. Pressed, Just Pressed, Released, Just Released everywhere, so “all four released” for standing still works now. The stick used to be held only.
  • Any Key / All Keys. Combine the ticked directions with Triggered When. Any Key fires on any of them, All Keys needs them held together, like Up + Right for a diagonal. Replaces the old 8 way deadzone.

v1.1:
BazInputCondition.gd (37.1 KB)

  • Analog stick now detected in Movement & Stick modes. These modes read each object’s actual per-player input set at runtime, so the left stick registers even when your movement keys aren’t bound directly to the stick axis. (Previously the stick could read as nothing in Movement / Stick.)
  • Multiplayer-aware. Single, Movement, and Stick all resolve to the controlling player’s own input (from the object’s player_id), so each player responds only to their own controller — automatic, no setup. Works for players 1–4.
  • Movement now uses a round (radial) deadzone. A diagonal push counts the same as a straight one: set Deadzone to 0.9 and a full diagonal still triggers. Directions are picked with 8-way bands (a diagonal lights both neighbours). Keyboard and D-pad behave exactly as before.
  • The “Released / at rest” check no longer mistakes a full diagonal for “released.”

v1.0:
BazInputCondition.gd (29.6 KB)

Requirements

AGMaker 1.3.0+

Installation

  1. Download BazInputCondition.gd (attached below).
  2. Place it in your project’s custom_conditions/ folder. If that folder doesn’t exist, create it at the project root. A subfolder like custom_conditions/input/ is fine.
  3. That’s it. It’ll show up in the Add Condition dialog under the Input / 入力 group. Nothing to enable.

What it does

Replaces AGMaker’s built-in Input condition with full analog support.

  • Two modes: Single (one key) and Movement (4 Keys) — up to four directional keys from the object’s Move & Jump Settings, or four keys you pick.
  • Four timings: Pressed, Just Pressed, Released, and Just Released — in both modes.
  • Opt-in Deadzone: turn on Deadzone Enabled when a stick or trigger drives the input, and its slider becomes the threshold. Off, plain buttons read 0/1 and it does nothing.
  • Movement options: check any of Upward / Downward / Leftward / Rightward, combined with Any Key (any of them) or All Keys (all held together, e.g. Up + Right). The four keys come from the object’s Move & Jump Settings, or from your own Custom Keys.
  • Accept Frame Count: an input-buffer window that works across states, so jump-buffering just works.
  • Multiplayer-aware: each object reads only its controlling player’s input (players 1–4), automatically.

How to use

Add the condition to a transition, then set Input Mode. The fields update to match:

  • SingleInput Key (A, B, arrow_up, …) → Deadzone Enabled (→ Deadzone) → Input Method
  • Movement (4 Keys)Source (MoveAndJumpSetting Keys / Custom Keys) → the four directions (toggles, or key pickers under Custom Keys) → Triggered When (Any Key / All Keys) → Deadzone Enabled (→ Deadzone) → Input Method

What each field does:

  • Input Method is the timing: Pressed (held), Just Pressed (the frame it goes down), Released, or Just Released.
  • Deadzone Enabled / Deadzone — switch on for analog; the slider is how far a stick or trigger must be pushed to count (0 to 1). Off, a normal button reads 0/1 and ignores it.
  • Triggered When — Any Key (matches if any chosen direction fits) or All Keys (only when every chosen direction fits at once).
  • Accept Frame Count (shown for the Just timings) remembers the press for N frames, so a transition can accept it slightly late — like pressing jump just before you land. It works across state changes.

Tips

  • Deadzone is opt-in and analog-only. It does nothing unless Deadzone Enabled is on, and buttons read 0/1 regardless.
  • “Not moving” is easy now: Movement (4 Keys), all four ticked, Triggered When → Any Key, Input Method → Released → true whenever the object isn’t moving.
  • For analog Released checks, keep Deadzone modest. A “released” check is true while the stick is below the deadzone, so a high deadzone reports “released” while you’re still pushing. When you pair Pressed (start) with Released (stop), set the Released condition’s Deadzone smaller than the Pressed one — the gap between the two thresholds buffers against the input flickering on/off when the stick rests near the line.
  • Movement directions follow each object’s Move & Jump Settings (or your Custom Keys). Objects without one fall back to the arrow keys.
  • Diagonals: Triggered When → All Keys with, e.g., Upward + Rightward.
7 Likes

You always amaze me,

This plugin effectively resolves the issue of dead zones being ineffective in AGM’s mapping inputs. A huge thank you to baz for this contribution!

I tested three different input methods using a PS4 controller. The first method’s dead zone is now functional, allowing the joystick to move through a wider range of angles before triggering key combinations.

I haven’t yet figured out how to operate the second and third methods. I even tried removing the original joystick mapping in AGM, but I still couldn’t use the joystick for movement detection.

Thanks for trying it out!

I pushed an update today (v1.1) that does the following:

  • Analog stick now detected in Movement & Stick modes. These modes read each object’s actual per-player input set at runtime, so the left stick registers even when your movement keys aren’t bound directly to the stick axis. (Previously the stick could read as nothing in Movement / Stick.)
  • Multiplayer-aware. Single, Movement, and Stick all resolve to the controlling player’s own input (from the object’s player_id), so each player responds only to their own controller — automatic, no setup. Works for players 1–4.
  • Movement now uses a round (radial) deadzone. A diagonal push counts the same as a straight one: set Deadzone to 0.9 and a full diagonal still triggers. Directions are picked with 8-way bands (a diagonal lights both neighbours). Keyboard and D-pad behave exactly as before.
  • The “Released / at rest” check no longer mistakes a full diagonal for “released.”

Wow, multiplayer controller support looks awesome!
I directly overwrote with v1.1 and ran another round of tests,
but the interface seems unchanged. I couldn’t see the circular (radial) dead zone in handheld mode.

Movement and joystick controls are still unresponsive. It might be an issue with my own setup. I’ll continue experimenting.

To confirm, do you have the stick inputs associated with the move inputs on the MoveAndJumpSettings?

MoveAndJumpSettings only has left and right set, not up and down. :flushed_face:
I didn’t set up and down at the time because it’s a side-scrolling game, and setting up and down would require changing all the up and down movement values to 0.

This is probably the reason it failed to recognize. Thanks for the guidance!

Ah I hadn’t considered that scenario! Perhaps I will redesign it not be tied to MoveAndJumpSettings when I get a chance. Until then at least there is a way to get it working and now people will understand the workaround from your post.

Makes me wonder if only checking Left/Right would have worked like this:

I believe it will work, as it makes logical sense.

As you mentioned, you provided several actionable solutions. I am now very satisfied that I can use key mapping to set the dead zone, allowing the joystick to achieve its desired detection area. Thank you to baz for their contributions to the community!!!

Updated to v1.2

  • Complete design changeover which was necessary to be full compatible with AGM inputs, specifically with local coop setups.
  • It remains 100% true to the AGM way of handling input.
  • IMO way easier to understand.
  • Might require redoing any of the conditions you have already made.
1 Like