Hi,

I recently opened a project in Godot v3.5.1 that I haven't opened in 6 months and have been updating the code (C#) using mostly guesswork so that it will run again. Most of the errors require nothing more than common sense to fix, however I'm getting an error every time I use Input, for instance:

Input.SetMouseMode(Input.MouseMode.Hidden);

... results in the following error:

Member 'Input.MouseModeEnum.Hidden' cannot be accessed with an instance reference; qualify it with a type name instead

Since there is no documentation to really speak of other than docs.godotengine.org (this doesn't seem to have changed at all, it appears to have nothing to say about how to properly reference Input) I am at a bit of a loss. Since I am not actually creating an instance of Input (using i.e. new Input()) and am already calling it directly as a static reference I really have no idea what this error is referring to.

Does anyone have any idea how to solve this? Any help would be appreciated, thanks.

I'm having the exact same issue in Godot 4 beta. One of the first lines of code I try to write in this new version and I've already hit a roadblock! I hope this is addressed shortly.

This is how it works in gdscript with 3.5.1.

Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)

Hi, thanks for the replies. After dipping in and out of this problem for a week I've come no closer to solving this. There seems to be no documentation for the new release (for the new Input syntax) and I'm actually close to completely rewriting this project (that I've spent 3 years on) in another engine, which would be a huge undertaking (50,000 lines of code) but I've just reached that point. I really don't understand why the Godot developers would spend so much time and effort working on such a great engine but then spend absolutely no effort documenting those features / feature changes, and I've had enough. My excitement for v4.0 is proportional to my perception of how easy it will be to port my project over, and from what I've seen so far it looks like C# users will be completely left out in the cold and will still have to rely on guesswork. Hopefully I will be wrong as I absolutely love this engine otherwise.

So anyway, I don't suppose anyone has figured this one out yet? 🙂

The docs have been updated, at least all the API is up to date. You have to click the latest on the bottom left or press F1 in the editor.

https://docs.godotengine.org/en/latest/

This is how it is done in GDScript:

DisplayServer.mouse_set_mode(Input.MOUSE_MODE_HIDDEN)

Thanks for the reply. Yes, the API has been updated for GDScript but there seems to be nothing available for C Sharp, the only traces of information that I can find on forums etc are months or even years out of date. I have tried using Input.MOUSE_MODE_HIDDEN, but get the error "Input does not contain a definition for MOUSE_MODE_HIDDEN", so simply using guesswork and imitating the GDScript naming does not translate at all in this case. There is literally no official information available online on how to access this enum in C Sharp for ANY version, and since I'm using VS Code as my editor I cannot rely on autocomplete to reveal the answer since the extension "C Sharp Tools for Godot" hasn't worked on Linux for months (at least for me). This is only a hobby for me, but I can only imagine the frustration a developer would feel if they were trying to use Godot + C# in a professional work environment.

If it is still possible to access this enum at all in C Sharp then the makers of Godot have not provided any method for people to learn what it is, other than (presumably) telepathy or entering various random combinations of characters until we get lucky. If I am wrong, then I would greatly appreciate it if somebody could point me in the right direction, thanks.

In case anyone is having the same exact problem, I eventually tried the following and it appears to work:

Input.MouseMode = Input.MouseModeEnum.Visible