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

API update to include locking the mouse to the center of the screen, or a way to obtain mouse delta movement directly. #936

Open
qJesusp opened this issue Feb 1, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@qJesusp
Copy link

qJesusp commented Feb 1, 2022

Is your feature request related to a problem? Please describe.
It's difficult, maybe impossible, to make custom first person camera systems (that don't use lock to player). The problem I have is obtaining the mouse delta to update the camera rotation based off of the mouse movement. When using UI.GetCursorPosition() to retrieve the cursor position and comparing it to the position of the previous frame to generate a mouse delta, the cursor may collide with the edges of the viewport. This collision restricts the cursor's movement, and leads to false mouse delta data.

Describe the solution you'd like
If there was a function to manually set the cursor's position, one could set it to the center of the screen after cursor movement was detected, and then use the data from the cursor movement to generate mouse delta data. Another possible solution would include a UI.GetMouseDelta() that returns a vector2 value containing the movement of the mouse during the previous frame.

Describe alternatives you've considered
Simply using the First Person Camera template would be the most straightforward solution, but I want more freedom over the camera's positions and data. Whenever the camera is locked to the player, the :GetWorldPosition() and :GetWorldRotation(), as well as the functions to set them don't work properly.

Additional context
Here is a forum post I've made about the issue https://forums.coregames.com/t/cant-reliably-obtain-mouse-delta/2755

Thank you.

@qJesusp qJesusp added the enhancement New feature or request label Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant