Input.action_press()
accepts and sets action state to out-of-bounds strength values
#89945
Labels
Milestone
Tested versions
Reproducible in v4.1.1.stable.mono.official [bd6af8e], v4.2.1.stable.mono.official [b09f793], v4.3.dev.mono.custom_build [7d151c8]
System information
Godot v4.2.1.stable.mono - Windows 10.0.22631
Issue description
Input.action_press()
should only accept values for itsstrength
parameter between 0 and 1, and likewiseInput.get_action_strength()
should only return values between 0 and 1. The analogousInputEventAction.strength
property is correctly clamped between 0 and 1, and cannot be set outside that range.However,
Input.action_press()
does not bounds-check the strength parameter, and if passed a value greater than 1, sets the action state to an out-of-bounds value, causingInput.get_action_strength()
to return the same out-of-bounds value. In v4.1, values less than 0 are also accepted into action state.Illustrative screenshot of the MRP (running in v4.2), which shows the correct behavior of the
InputEventAction.strength
property as well as the bug inInput.action_press()
:Steps to reproduce
See attached MRP, or do:
For v4.1,
Input.action_press("test_action", -1.0)
will also produce incorrect output.Minimal reproduction project (MRP)
ActionPressStrengthMRP.zip
The text was updated successfully, but these errors were encountered: