So currently I have an object rotation script that is connected to sliders. Only problem is im not sure how to move it in one direction then make it go back to the original position based on where slider is, I probably will have to store max min and current but not sure how to implement:
public void W_KeyRotate(int wControl){
targetRotation *= Quaternion.Euler(mainCamera.transform.right * rotationAmount);
}
private void Snap()
{
Vector3 vec = targetRotation.eulerAngles;
vec.x = Mathf.Round(vec.x / rotationAmount) * rotationAmount;
vec.y = Mathf.Round(vec.y / rotationAmount) * rotationAmount;
vec.z = Mathf.Round(vec.z / rotationAmount) * rotationAmount;
targetRotation.eulerAngles = vec;
}
thats just part of the code