{"record":{"id":"830f9a34ff4bf6bb","repo":"bevyengine/bevy","slug":"invalid-press-threshold-0-expected-0-0-1-0","errorCode":null,"errorMessage":"invalid press_threshold {0}, expected [0.0..=1.0]","messagePattern":"invalid press_threshold (.+?), expected \\[0\\.0\\.\\.=1\\.0\\]","errorType":"validation","errorClass":"ButtonSettingsError","httpStatus":null,"severity":"error","filePath":"crates/bevy_input/src/gamepad.rs","lineNumber":328,"sourceCode":"    DeadZoneUpperBoundGreaterThanLiveZoneUpperBound {\n        /// The value of the `livezone_upperbound` parameter.\n        livezone_upperbound: f32,\n        /// The value of the `deadzone_upperbound` parameter.\n        deadzone_upperbound: f32,\n    },\n    /// The given parameter was not in range 0.0..=2.0.\n    #[error(\"invalid threshold {0}, expected 0.0 <= threshold <= 2.0\")]\n    Threshold(f32),\n}\n\n/// Errors that occur when setting button settings for gamepad input.\n#[derive(Error, Debug, PartialEq)]\npub enum ButtonSettingsError {\n    /// The given parameter was not in range 0.0..=1.0.\n    #[error(\"invalid release_threshold {0}, expected value [0.0..=1.0]\")]\n    ReleaseThresholdOutOfRange(f32),\n    /// The given parameter was not in range 0.0..=1.0.\n    #[error(\"invalid press_threshold {0}, expected [0.0..=1.0]\")]\n    PressThresholdOutOfRange(f32),\n    /// Parameter `release_threshold` was not less than or equal to `press_threshold`.\n    #[error(\"invalid parameter values release_threshold {} press_threshold {}, expected release_threshold <= press_threshold\", release_threshold, press_threshold)]\n    ReleaseThresholdGreaterThanPressThreshold {\n        /// The value of the `press_threshold` parameter.\n        press_threshold: f32,\n        /// The value of the `release_threshold` parameter.\n        release_threshold: f32,\n    },\n}\n\n/// Stores a connected gamepad's metadata such as the name and its [`GamepadButton`] and [`GamepadAxis`].\n///\n/// An entity with this component is spawned automatically after [`GamepadConnectionEvent`]\n/// and updated by [`gamepad_event_processing_system`].\n///\n/// See also [`GamepadSettings`] for configuration.\n///","sourceCodeStart":310,"sourceCodeEnd":346,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_input/src/gamepad.rs#L310-L346","documentation":"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.","triggerScenarios":"Thrown at crates/bevy_input/src/gamepad.rs:328 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Clamp press_threshold to [0.0, 1.0]","Validate user-provided settings before constructing GamepadButtonSettings"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}