I am using the code below to rotate something, however it only rotates the object to 90 degrees even though the angle changes from 0-90 in the debug log. If I switch the variable currentvalue to an actual integer like 45 then it will rotate correctly, does anyone know why this might be happening?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RopeRotation2 : MonoBehaviour
{
public GameObject object7;
public Slider_Script barangle;
private float currentvalue;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
currentvalue = barangle.value;
object7.transform.eulerAngles = new Vector3(object7.transform.eulerAngles.x, object7.transform.eulerAngles.y, currentvalue);
Debug.Log(currentvalue);
}
}