am trying to make the camera slerp to -30 on the x axis even though it keeps doing a 180, ive tried local rotation same thing ive tried lerp same thing i dont know why its not working, heres the code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class rotatecam : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
myInput();
}
void myInput()
{
if (Input.GetKey("w"))
{
transform.rotation = Quaternion.Slerp(transform.rotation, new Quaternion(-30, 0, 0, 1), 5 * Time.deltaTime);
}
}