I need the player in my game to be able to rotate a grabbed object in every axis easily. Now I’m using arrow keys to rotate it in one axis, but I want to change to a mouse based solution. What would be the best way to do it?
Ctrl+Mouse Scroll = rotate on X
Shift+Scroll = rotate on Y
Alt+Scroll = rotate on Z
There’s also the option of holding left click on the mouse & then rotating the object based on the direction the mouse is moved while the button is held down.
I would like to do that but it wouldn’t work with all axis.
Thanks. I might use that.
You’re welcome ![]()
Apparenlty scrolling returns always zero when pressing shift. Weird. You should try it.
if (Input.GetKey(KeyCode.LeftShift)){
Debug.Log(Input.GetAxis("Mouse ScrollWheel"));
}
In my game it doesn’t (ctrl and shift are used here to modulate zooming speed of camera, though I probably get rid of that when I have satisfying default speed). But I have shift/ctrl set up as buttons in Unity’s InputManager instead of accessing keycodes directly, so maybe it’s that.
It seems to be a mac feature. Shift is supposed to change direction to vertical. Does anyone know how to disable vertical scrolling with shift for unity application or do I need to ask mac users to go to system preferences?
@darkhog I made the thing and I like it.