Open Mr-SkyLark opened 1 year ago
Also getting this on 4.0.1-rc1
Errors reproduce on 4.0.1
@Mr-SkyLark Please upload a minimal reproduction project to make this easier to troubleshoot. (The project.godot
and Player.cpp
files make it possible to reproduce this locally, but it requires a lot of manual setup which not everyone has time for.)
@dodgyville @Ethosa Are you reproducing this with a GDExtension? If not, this is an unrelated issue.
@Calinou I have updated my report. I added ZIP file with minimum reproduction project. It contains C++ project and ready dll in the godot project.
Hello, I'm facing the same issue.
I configured a custom input map in project settings and referenced it in the GDExtension C++ code.
The input map actually works, which means that input is trigged by pressing the according key button, but the
The InputMap action "move_up" doesn't exist. Did you mean "ui_up"?
is printed at each frame in the Output log, even in editing mode
I have this issue but the user input doesn't actually work and I get the spamming errors.
Hi @nvanfleet,
in my experience if you correctly set the input map in the project settings, you should have no issue at runtime (playmode).
Since GDExtension is loaded when editor starts, and the _process
function is called per each frame, it seems to me that the editor loads the GDExtension before the input map configuration.
Indeed, if you use one of the default action like ui_up
, you have a moving player also in editor.
This proves that the input map is simply loaded later.
As workaround, you can use this is snippet
#include <godot_cpp/classes/engine.hpp>
void Player::_process(float delta) {
if (Engine::get_singleton()->is_editor_hint()) return; // Early return if we are in editor
auto input = Input::get_singleton();
if (input->is_action_pressed("move_up")) {
// do stuff
}
}
Sadly, using the Engine
singleton is know to produce a memory leak and crash when exiting the game. https://github.com/godotengine/godot-cpp/issues/889
I have just started getting this same issue on a project I haven't touched in a week or so. Godot 3.5.2 using GDScript. It wasn't doing this the last time I worked on it, and as far as I can tell nothing has changed (git shows no files changed from my last commit). The InputMap actions are showing up in my project settings, and they all seem to work. The editor starts complaining as soon as I load the scene, and if I comment out the three lines that reference those custom input mappings, save the attached script, close the scene, then reopen it the warnings stop. If I close Godot and reopen it the errors come back until I run through the process again.
My newbie friend has encountered this problem in gdscript, and I don't think the current way of handling it is appropriate and gives enough information.
This should be the same as the problem with gdscript in tool mode, which is caused by the editor itself not using the project custom InputMap.
There are no plans to have the editor load the project InputMap, but could we stop the spamming and then just output a warning telling the user not to use the InputMap in the editor.
Of course we can also add a placeholder Action inside the editor using InputMap.add_action("action")
to stop spamming.
GDScript issue:
...but could we stop the spamming and then just output a warning telling the user not to use the InputMap in the editor.
Great idea.
I have just started getting this same issue on a project I haven't touched in a week or so.
Same for me, on Godot 4.1.1
What fixed it for me was to remove the @tool
from script in which I checked for the InputMap, then I closed Godot and then I deleted the .godot directory in the project to make sure no cached references remained. Afterwards worked again fine! :smiling_face_with_tear:
For workaround, you can call InputMap.load_from_project_settings()
inside _ready() function
For workaround, you can call
InputMap.load_from_project_settings()
inside _ready() function
When I do this, I get the custom action to work, but then it throws a bunch of errors about the various FreeLook inputs:
The InputMap action "spatial_editor/freelook_forward" doesn't exist.
Godot version
4.0.stable.official 4.0.2.stable.official
System information
Windows 10
Issue description
Output log sends many messages: The InputMap action "move_up" doesn't exist. Did you mean "ui_up"? But Godot knows and finds action.
Steps to reproduce
project.godot
Player.cpp
Minimal reproduction project
bug_gdextension.zip