- Home /
Question by
SwirlyMcGee · Oct 18, 2021 at 10:51 PM ·
rotationscripting probleminputscripting beginnermouse scroll
How to rotate with mouse scroll wheel and new input system?
Hey guys, this is probably a really easy one to answer, but I want to rotate an object an additional 22.5 degrees around the Y-axis every time I scroll up on the mouse wheel (or -22.5 if I scroll down). I've tried this so far (in the update function):
Vector3 newRotation = new Vector3(0, 22.5f * inputCamera.Map.MouseScroll.ReadValue<float>(), 0);
transform.eulerAngles = newRotation;
Any suggestions?
Comment
Answer by Rechronicle · Oct 19, 2021 at 04:07 AM
try using Rotate() method instead of directly changing the rotation property.