How to rotate a Game object using mouse scroll wheel?

Hello! I am trying to rotate the angle X of my Game Object using the scroll wheel.
I’ve done a simple script to detect the scroll wheel movement:

if (Input.GetAxis("Mouse ScrollWheel") > 0) { // rotation script }

Now I need to rotate my Game Object in Angle X.
Thanks.

http://docs.unity3d.com/Documentation/ScriptReference/Transform.Rotate.html

Hello, I got the result using the following code:

if (Input.GetAxis("Mouse ScrollWheel") > 0) {
	transform.Rotate(Vector3.left * 0.5f, Space.Self);
}
if (Input.GetAxis("Mouse ScrollWheel") < 0) {
	transform.Rotate(Vector3.right * 0.5f, Space.Self);
}

Thanks for the replies.

2 Likes
            if (Input.mouseScrollDelta.y != 0)
            {
                transform.Rotate(Vector3.right * Input.mouseScrollDelta.y);
            }

im a lil late

1 Like