• Preventing mouse input from changing view angles
    4 replies, posted
I'd like to do view angle changes completely on my own whenever players move their mouse. How do i override the default behaviour? (Easy weld does this by returning true in TOOL:FreezeMovement() for example, so you can rotate the prop instead of your view.) I know about CUserCmd:SetViewAngles() and so on, it's just that the default behaviour is still in there, and if the fps is low enough it becomes really apparent. Calling player:Freeze() is not really an option either because i still want the player to be able to walk. At the moment i am using a hook on "InputMouseApply" - returning false or true doesn't do anything, neither does CUserCmd:SetMouseX() and Y
Just use GM:CalcView and return view.angles as a constant angle.
Maybe GM/AdjustMouseSensitivity could be useful? Try disabling the sensitivity there? Probably won't stop changing the view by means other than mouse input, but thats probably what you want.
I fixed this by moving the player angle manipulation from InputMouseApply to CreateMove (Both of them beeing hooks using hook.Add) Now i'll just have to figure out the most precise way to grab mouse input, i believe grabbing mouse input inside InputMouseApply and manipulating the angle inside CreateMove might be the best solution? I'm not sure - i want this to be as close as possible to raw input
I believe you can do it using CUserCmd/GetMouseX and CUserCmd/GetMouseY, in either CreateMove or SetupMove
Sorry, you need to Log In to post a reply to this thread.