I'm currently making some changes to my Camera script, and someone mentioned that Roblox has Mouse Acceleration on and they didn't like it. Because I'm making my own version of the camera, I'd like to be able to add the option to disable this. But I can't work out how to get it to work :S Is there any good documentation on this?
So after eLunate's answer I've edited my script from changing all changes in Delta to 1, 0 or -1 by using the following:
local MoveX = type.Delta.X local MoveY = type.Delta.Y if MouseAccel == false then print("Ay") MoveX = math.sqrt(type.Delta.X) MoveY = math.sqrt(type.Delta.Y) print(type.Delta, " Compared to: ",MoveX,"",MoveY)
However, I am recieving the following prints:
-7, -2, 0 Compared to: -1.#IND -1.#IND Ay -5, -1, 0 Compared to: -1.#IND -1.#IND Ay -6, -3, 0 Compared to: -1.#IND -1.#IND Ay -4, 0, 0 Compared to: -1.#IND 0
Any suggestions?
You can't get the root of negative numbers
Think positive
In order to get the root of a negative number, you can probably try something like this:
local _sqrt = math.sqrt; local sqrt = function(n) _n = _sqrt(math.abs(n)); if n < 0 then return -_n end return _n end