Allow getting Input axis/vector values by specifying multiple actions
For get_vector, use raw values and handle deadzones appropriately
This commit is contained in:
parent
195d58be0f
commit
4abf189e36
5 changed files with 87 additions and 2 deletions
|
|
@ -118,6 +118,12 @@ bool InputMap::has_action(const StringName &p_action) const {
|
|||
return input_map.has(p_action);
|
||||
}
|
||||
|
||||
float InputMap::action_get_deadzone(const StringName &p_action) {
|
||||
ERR_FAIL_COND_V_MSG(!input_map.has(p_action), 0.0f, "Request for nonexistent InputMap action '" + String(p_action) + "'.");
|
||||
|
||||
return input_map[p_action].deadzone;
|
||||
}
|
||||
|
||||
void InputMap::action_set_deadzone(const StringName &p_action, float p_deadzone) {
|
||||
ERR_FAIL_COND_MSG(!input_map.has(p_action), "Request for nonexistent InputMap action '" + String(p_action) + "'.");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue