- Home /
Question by
_JayRay_ · Oct 24, 2013 at 05:12 AM ·
movementy axisscrollwheelscroll-wheel
Mouse ScrollWheel and character Y axis movement
im doing an assignments that needs 6 degrees of movement and i wanted the mouse scrollwheel to control the Players Y axis movement does anyone know how to go about this???
thanks
Comment
Answer by robertbu · Oct 24, 2013 at 05:14 AM
Your use of 'movement' and 'degrees' is confusing. Since you use 'y' axis, I assume you are trying to control the 'y' rotation of an object using the scroll wheel. Here is a bit of code to get you started:
#pragma strict
var factor = 2.5;
function Update() {
transform.Rotate(Vector3(0.0, Input.GetAxis("Mouse ScrollWheel")*factor, 0.0));
}
Your answer
Follow this Question
Related Questions
Unity Movement 1 Answer
Moving on the Y axis - wont move 'up' 2 Answers
Rotate whole scene by 90 degrees 1 Answer
Simple way to make an object go up and down?(Y axis) 1 Answer
The name 'Joystick' does not denote a valid type ('not found') 2 Answers