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

Allow binding mouse movement and mouse scrolling #8763

Closed
Shadowblitz16 opened this issue Dec 31, 2023 · 3 comments
Closed

Allow binding mouse movement and mouse scrolling #8763

Shadowblitz16 opened this issue Dec 31, 2023 · 3 comments

Comments

@Shadowblitz16
Copy link

Shadowblitz16 commented Dec 31, 2023

Describe the project you are working on

SpaceShip game

Describe the problem or limitation you are having in your project

I am using behavior trees and would like to reference mouse input through actions names

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Allow the following to be bound as a Input Action

  • Mouse Move Up

  • Mouse Move Down

  • Mouse Move Left

  • Mouse Move Right

  • Mouse Scroll Up

  • Mouse Scroll Down

  • Mouse Scroll Left

  • Mouse Scroll Right

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

They would be bound as MouseMotion events

If this enhancement will not be used often, can it be worked around with a few lines of script?

No. We can still manually check for mouse input but the point of input actions is so we can bind input for our games.

Is there a reason why this should be core and not an add-on in the asset library?

InputMouseMotion is already an event so it should be pretty simple to implement.

@Shadowblitz16
Copy link
Author

@Mickeon
The up, down, left, right are the four cardinal directions on a 2d plane
They can be combined into two axes x and y and one vector2

Mouse position would probably be read using Input.get_vector

@Mickeon
Copy link

Mickeon commented Dec 31, 2023

No, nothing of this can work in the current implementation of actions. Mouse movement is very, very inconsistent and prone to slight changes. Allowing InputEventMouseMotion events as actions would not benefit anyone the same way you may think they would.

Depending on the implementation, the associated actions would be triggered either at the slight tilt of the mouse towards the desired direction, or not at all, because the detection is too precise. Neither are good.
Their strength value would wildly fluctuate. strength also needs to be a value between 0 and 1, and remapping the mouse "speed" to that range would be very arbitrary.

If you want to have something like this exclusively for your project, you can try binding an InputEvent to an action manually, see the InputMap documentation.

@AThousandShips
Copy link
Member

AThousandShips commented Dec 31, 2023

Thank you for your proposal, closing as a duplicate of:

Consolidating there

@AThousandShips AThousandShips marked this as a duplicate of #3070 Dec 31, 2023
@AThousandShips AThousandShips closed this as not planned Won't fix, can't repro, duplicate, stale Dec 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants