bevyengine/bevy · error · ButtonSettingsError
invalid press_threshold {0}, expected [0.0..=1.0]
Error message
invalid press_threshold {0}, expected [0.0..=1.0] What it means
ButtonSettingsError validation variant: press_threshold was outside the required 0.0..=1.0 range. The press threshold is the axis value above which the virtual button counts as pressed; it must be greater than or equal to release_threshold.
Source
Thrown at crates/bevy_input/src/gamepad.rs:328
DeadZoneUpperBoundGreaterThanLiveZoneUpperBound {
/// The value of the `livezone_upperbound` parameter.
livezone_upperbound: f32,
/// The value of the `deadzone_upperbound` parameter.
deadzone_upperbound: f32,
},
/// The given parameter was not in range 0.0..=2.0.
#[error("invalid threshold {0}, expected 0.0 <= threshold <= 2.0")]
Threshold(f32),
}
/// Errors that occur when setting button settings for gamepad input.
#[derive(Error, Debug, PartialEq)]
pub enum ButtonSettingsError {
/// The given parameter was not in range 0.0..=1.0.
#[error("invalid release_threshold {0}, expected value [0.0..=1.0]")]
ReleaseThresholdOutOfRange(f32),
/// The given parameter was not in range 0.0..=1.0.
#[error("invalid press_threshold {0}, expected [0.0..=1.0]")]
PressThresholdOutOfRange(f32),
/// Parameter `release_threshold` was not less than or equal to `press_threshold`.
#[error("invalid parameter values release_threshold {} press_threshold {}, expected release_threshold <= press_threshold", release_threshold, press_threshold)]
ReleaseThresholdGreaterThanPressThreshold {
/// The value of the `press_threshold` parameter.
press_threshold: f32,
/// The value of the `release_threshold` parameter.
release_threshold: f32,
},
}
/// Stores a connected gamepad's metadata such as the name and its [`GamepadButton`] and [`GamepadAxis`].
///
/// An entity with this component is spawned automatically after [`GamepadConnectionEvent`]
/// and updated by [`gamepad_event_processing_system`].
///
/// See also [`GamepadSettings`] for configuration.
///View on GitHub (pinned to 396ca72708)
Solutions
- Clamp press_threshold to [0.0, 1.0]
- Validate user-provided settings before constructing GamepadButtonSettings
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/bevy_input/src/gamepad.rs:328 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of bevyengine/bevy@396ca72708 (2026-08-20).
Data as JSON: /api/errors/830f9a34ff4bf6bb.
Report an issue: GitHub.