tipforeveryone Posted June 18, 2017 Share Posted June 18, 2017 In 4.4 beta, Moving the mouse and sometime it gets floating even I dont touch my mouse. It happens even in fullscreen mode Not happen in 4.3 Link to comment Share on other sites More sharing options...
Josh Posted June 19, 2017 Share Posted June 19, 2017 Thank you for reporting this. Although I cannot produce the problem, I made a change that might fix it for you. Please try the latest update and tell me if it helps. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
tipforeveryone Posted June 19, 2017 Author Share Posted June 19, 2017 It is still floating, even crazier lol. I replaced my mouse but it does not help Link to comment Share on other sites More sharing options...
Josh Posted June 19, 2017 Share Posted June 19, 2017 What version of Windows is this? What scaling value do you have set for Windows? My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
tipforeveryone Posted June 19, 2017 Author Share Posted June 19, 2017 Mine is windows 10, and this is my display setting I switched Scale to 100% and everything is ok now, but this still need to be fixed for other scale option of windows :"D with 100% scale, every text on my screen is so small, I can't switch between 100 and 125% every time I wanna test my game hehe Link to comment Share on other sites More sharing options...
Josh Posted June 19, 2017 Share Posted June 19, 2017 Okay, I will try 125% tomorrow. 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted June 19, 2017 Share Posted June 19, 2017 Okay, I get the same result at 125%... My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted June 19, 2017 Share Posted June 19, 2017 The problem is that ClientToScreen and ScreenToClient don't match at that scaling factor. void Window::SetMousePosition(const float x, const float y) { POINT point; point.x = Math::Round(x); point.y = Math::Round(y); ClientToScreen(hwnd, &point); SetPhysicalCursorPos(point.x, point.y); //Test POINT testpoint = point; ScreenToClient(hwnd, &testpoint); Debug::Assert(testpoint.x == point.x); Debug::Assert(testpoint.y == point.y); } My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted June 19, 2017 Share Posted June 19, 2017 There is a way around this if we modify our FPS Player script. First we get the mouse coordinate immediately after it is set: --Mouse look self.currentMousePos = window:GetMousePosition() window:SetMousePosition(Math:Round(context:GetWidth()/2), Math:Round(context:GetHeight()/2)) local centerpos = window:GetMousePosition() self.currentMousePos.x = Math:Round(self.currentMousePos.x) self.currentMousePos.y = Math:Round(self.currentMousePos.y) And then we compare the current position to that instead of the context center: self.mouseDifference.x = Math:Curve(self.currentMousePos.x - centerpos.x,self.mouseDifference.x,2/Time:GetSpeed()) self.mouseDifference.y = Math:Curve(self.currentMousePos.y - centerpos.y,self.mouseDifference.y,2/Time:GetSpeed()) self.camRotation.x = Math:Clamp(self.camRotation.x + self.mouseDifference.y / self.mouseSensitivity,-90,90) self.camRotation.y = self.camRotation.y + (self.mouseDifference.x / self.mouseSensitivity) My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted June 19, 2017 Share Posted June 19, 2017 I updated the FPSPlayer and Spectator scripts. Should work now. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts