- Home /
mousewheel tilt
So I'm working on a project where i have a joystick so up and down are zoom and left and right to scroll threw a menu, now I'm trying to make it compatible with the mouse. The scroll wheel is being used for zoom but now i was thinking of using the mouse wheel tilt left and right for the left and right function of the joystick.
The question is what do i use for the tilting of the mouse i haven't really found an answer yet, i have left and right button scrolling and such working but tilting the mouse wheel i cant seem to find the names for.
Any help in this regard would be appreciated.
Answer by TheManSquid · Oct 28, 2017 at 03:03 AM
You can set this up by going to Edit > Project Settings > Input. Make sure that Type is set to Mouse Movement and the Axis to 4th Axis (Joysticks). Then in your code use:
if (Input.GetAxisRaw("Mouse ScrollWheel Sides") > 0) {
// tilt right
}
else if (Input.GetAxisRaw("Mouse ScrollWheel Sides") < 0) {
// tilt left
}