I have created a simple C++ "game" in godot. Lacking any good documentation, I based my work off examples on the internet, and for input I have this:
const Input* i = Input::get_singleton();
double delta_v = 0;
if (i->is_action_pressed("ui_up"))
delta_v += acceleration * delta;
if (i->is_action_pressed("ui_down"))
delta_v -= acceleration * delta;
if (i->is_action_pressed("ui_left"))
angular_velocity -= angular_acceleration * delta;
if (i->is_action_pressed("ui_right"))
angular_velocity += angular_acceleration * delta;
Based on that, I wanted to add a new action triggered by space. So I tried this:
const Input* i = Input::get_singleton();
if (i->is_action_pressed("ui_space""game_shoot"))
{
}
I then added this action in the project key mapping:
But I am getting an error:
The InputMap action "ui_space""game_shoot" doesn't exist. Did you mean "ui_text_backspace"?
Thing is, I cannot find any referrence to the correct names of input keys. I did find docs that contain enums for themCuriously, but that is no use for a method that expectsit works from a string.script like this:
func _input(event):
if event.is_action_pressed("game_shoot"):
print("game_shoot occurred!")
