mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 14:11:15 +00:00
Fix action_press() by clamping strength to 0, 1
Changed Input.action_press() treatment of strength parameter to match behavior of InputEventAction and documentation, by clamping between 0 and 1. Fixes Input.get_action_strength() returning values over 1 when large values are passed to Input.action_press().
This commit is contained in:
parent
7d151c8381
commit
41e70db8b1
1 changed files with 1 additions and 1 deletions
|
|
@ -894,7 +894,7 @@ void Input::action_press(const StringName &p_action, float p_strength) {
|
|||
}
|
||||
action_state.exact = true;
|
||||
action_state.api_pressed = true;
|
||||
action_state.api_strength = p_strength;
|
||||
action_state.api_strength = CLAMP(p_strength, 0.0f, 1.0f);
|
||||
_update_action_cache(p_action, action_state);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue