Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make freelook not center the mouse cursor after exiting freelook mode (and remove the crosshair) #1076

Closed
Flavelius opened this issue Jun 17, 2020 · 3 comments · Fixed by godotengine/godot#39625
Milestone

Comments

@Flavelius
Copy link

Flavelius commented Jun 17, 2020

Describe the project you are working on:
Just looking forward to using godot

Describe the problem or limitation you are having in your project:
Looking around the 3D view with rightclick moves the cursor to the viewport center and displays a crosshair. Both of these actions are somewhat unnecessary and force-centering the cursor is even a little annoying as one has to reposition the mouse after every freelook (which in most cases is done quite frequently).

Describe the feature / enhancement and how it helps to overcome the problem or limitation:
There should be toggles to disable the display of the crosshair and for recentering on freelook, or alternatively the crosshair just be removed and recentering disabled by default.
The crosshair currently may be a tiny helper in certain circumstances for selecting objects, but only because the recentering (mis)behaviour is there too. If the cursor didn't recenter, releasing the mouse to select objects would be a more consistent/direct rotate-view-select flow.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
Internally the recentering could still be happening to make freelook work correctly, but on release the mouse should be positioned to the point where the initial click happened, as the action from a users point of view is 'grabbing the camera', not entering shooter mode. Or if implemented as setting there could even be an option that just does not lock the cursor (as unity does for example).
Removing the crosshair is probably simpler.

If this enhancement will not be used often, can it be worked around with a few lines of script?:
It's internal to the editor behaviour, so it can't be worked around.

Is there a reason why this should be core and not an add-on in the asset library?:
It's internal to the editor behaviour, so it can't be user-scripted.

@Calinou
Copy link
Member

Calinou commented Jun 17, 2020

There should be toggles to disable the display of the crosshair and for recentering on freelook, or alternatively the crosshair just be removed and recentering disabled by default.

See godotengine/godot#34801 where I added a crosshair. I decided against adding an editor setting as it doesn't seem like a significant enough feature to toggle. I would prefer solving the issue at hand rather than adding a setting (see below).

If we find a way to avoid the cursor centering when leaving freelook, we should remove the crosshair entirely as it'll no longer serve a purpose. This is possible but not 100% trivial, as the cursor is centered due to how Input.MOUSE_MODE_CAPTURED works. Input.warp_mouse_position() can be used to move the cursor forcibly, but it won't work if you do it too early - you may need to use call_deferred() to delay it by 1 frame.

@Calinou Calinou changed the title Improve Freelook viewmode Make freelook not center the mouse cursor after exiting freelook mode (and remove the crosshair) Jun 17, 2020
Calinou added a commit to Calinou/godot that referenced this issue Jun 17, 2020
- Remove the crosshair as it no longer serves a purpose (the cursor will
  now appear where the user "expects" it to).

This closes godotengine/godot-proposals#1076.
akien-mga pushed a commit to godotengine/godot that referenced this issue Jun 18, 2020
- Remove the crosshair as it no longer serves a purpose (the cursor will
  now appear where the user "expects" it to).

This closes godotengine/godot-proposals#1076.

(cherry picked from commit 4a542e0)
@aaronfranke aaronfranke added this to the 4.0 milestone Aug 5, 2020
@aaronfranke
Copy link
Member

@Flavelius What was the reason for wanting the crosshair removed? I thought it was nice. Just because it was unnecessary?

@Flavelius
Copy link
Author

Flavelius commented Sep 26, 2020

@aaronfranke It's somewhat related to the issue described in this thread. It only served as an indicator/visual confirmation that the hidden recentering happened.
Apart from that my personal reasoning is more related to the aesthetic; godot was the only editor to have an fps-crosshair (but you cannot shoot with it) and the sprite gave it a certain old-school aesthetic that may relate to some, but as godot is intended to be used for all type of games and people, making it a bit more neutral is probably a good decision. These are my opinions though, but i'm all behind the actual justification that it's unnecessary, now, even more that the correct/standard/expected mouse behaviour is restored. (And, if i'm not mistaken, and someone really needs this crosshair for some obscure reason, an editor plugin can provide that)

huhund pushed a commit to huhund/godot that referenced this issue Nov 10, 2020
- Remove the crosshair as it no longer serves a purpose (the cursor will
  now appear where the user "expects" it to).

This closes godotengine/godot-proposals#1076.

(cherry picked from commit 4a542e0)
edg1000 pushed a commit to edg1000/https-github.com-godotengine-godot that referenced this issue Apr 23, 2024
- Remove the crosshair as it no longer serves a purpose (the cursor will
  now appear where the user "expects" it to).

This closes godotengine/godot-proposals#1076.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants