
[ad_1]
I’ve created a easy C++ “recreation” in godot. Lacking any good documentation, I primarily based my work off examples on the web, and for enter I’ve 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 needed so as to add a brand new motion triggered by house. So I attempted this:
const Input* i = Input::get_singleton();
if (i->is_action_pressed("game_shoot"))
{
}
I then added this motion within the mission key mapping:
But I get an error:
The InputMap motion "game_shoot" does not exist.
Curiously, it really works from a script like this:
func _input(occasion):
if occasion.is_action_pressed("game_shoot"):
print("game_shoot occurred!")
[ad_2]