• input.IsMouseDown(MOUSE_WHEEL_DOWN) not working?
    2 replies, posted
Trying to change the CalcView based on MOUSE_WHEEL_DOWN/MOUSE_WHEEL_UP but its not working. Am I using IsMouseDown in the wrong hook? In the [URL="http://wiki.garrysmod.com/page/input/IsMouseDown"]wiki[/URL] it doesn't say if it needs to be called on a certain hook. [CODE]-- cl_init.lua hook.Add("Think", "PlayerInput", function() if input.IsMouseDown(MOUSE_WHEEL_DOWN) then print("up") elseif input.IsMouseDown(MOUSE_WHEEL_UP) then print("down") end end)[/CODE]
Use CreateMove. Examples: _cmd, used in CreateMove allows the use of GetMouseWheel: [url]http://wiki.garrysmod.com/page/CUserCmd/GetMouseWheel[/url] Simple example of one of many ways to "LERP" roll back to 0: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/camera/camera_roll_system.lua.html[/url] Example of my thirdperson free-camera: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/camera/cl_thirdperson_freecam.lua.html[/url] The free camera is more in-line with what can be done... Except in the example it checks for ALT + SCROLL. The GetFlag / SetFlag is part of my networking / data system, it'll be released soon. The third arg just means it is private ( although when the client sets a value, it isn't networked, so it could be in the "public" pool for the entity.. I cleaned up the free-cam code to bring it up to my coding-standards as it was old code; improved readability hopefully... As always, remove .html to view the .lua if you copy/paste anything as html doesn't copy well...
Thank you :D That is awesome!
Sorry, you need to Log In to post a reply to this thread.