- Home /
Input.GetAxis - Based on cursor screen position?
I'm using Input.GetAxis to move a Rigidbody object with the mouse by changing its velocity. This works fine, but I would like the cursor to stay on the Rigidbody.
I would like to know if Input.GetAxis("Mouse X") depends on the actual screen position of the cursor - or if this is getting mouse delta in some other, non-screen-dependant way?
Thanks!
Answer by FortisVenaliter · Aug 21, 2015 at 08:29 PM
It's the mouse delta. If you want the screen position, you can use Input.mousePosition
Thanks!
I'm looking for how the mouse delta is calculated in GetAxis.
Is the mouse delta calculated by the cursor's position on-screen, or by some other way? That is, is the cursor required on screen at all in order for GetAxis to calculate the mouse delta?
Thanks again.
I don't believe so, but you might want to try to create a unit test to make sure. Also, you can check the project Input settings to see how the axes are set up and edit the smoothing.
Your answer
Follow this Question
Related Questions
Make text follow cursow without any delays in Unity 4.6 0 Answers
Disable mouse input and cursor in game 2 Answers
How can I get a popup window to follow the cursor? 0 Answers
Can I somehow Screen.lockCursor off center instead of the center of the screen? (Oculus) 0 Answers
Get mouse position in Editor based on screen coordinates 1 Answer