As a default. the camera has a rotation of zero. I want to put a limit on it, so you can only rotate 45 degrees in either direction (so, from 0-45 or 0-315).
How would I word a check like that? I know it will be something like:
if(transform.eulerAngles > 45f)
{
transform.eulerAngles = 45f;
}
if(transform.eulerAngles <315f)
{
transform.eulerAngles = 315f;
}
But that doesn’t work mathematically. What am I missing?