How to change direction of rotation using Slider?

So the problem that I’m facing is that when I drag the handle to right the angle of the incoming ray increases which is good but the problem arises when I want to reduce the angle. What I can identify is that since even by dragging slider to left the value remains positive Unity increases the angle.
Is there any way to identify the direction in which the handle is being dragged and increase/ decrease the angle accordingly?

this is method I’ve written, it only increase the angle:

public void rotateLaser() { if (rotateSlider.direction == Slider.Direction.LeftToRight) { Light.SetPosition (0, startingPt.position); Laser.transform.RotateAround (endingPt.position, Vector3.forward, 10f); Light.SetPosition (1, endingPt.position); } if (rotateSlider.direction == Slider.Direction.RightToLeft) { Light.SetPosition (0, startingPt.position); Laser.transform.RotateAround (endingPt.position, Vector3.forward, -10f); Light.SetPosition (1, endingPt.position); } }

Thanks! in advance.

I may be misunderstanding what you are attempting to do here, but if you are trying to rotate an object based off of a slider’s position, it would be easier to simply set the slider’s min value to negative and then set the object’s rotation based off of it’s current value.

For instance, if you want to rotate left/right within 90 degrees, set the slider’s min/max values to -45/45 respectively and then set the object’s rotation value based off of the slider’s current value.

Just a note, Slider.Direction.RightToLeft/LeftToRight determines whether the slider’s minimum is on the left or right, not which direction the slider is being dragged.