I followed this tutorial from a few years ago about making an isometric view camera, and usually it works perfectly like the video, but somehow today when I followed the tutorial again the camera does not rotate as expected.
I would like to make it so the camera can rotate relative to the world (So its like the camera is rotating around a pivot and also facing towards it).
Everything else, movement, zoom, whatever works perfectly, just the rotation doesn’t, and I’ve checked many times that nothing should be wrong. Hope someone can explain what the problem is and how to fix it! Thanks!
Here is the rotation parts of the camera controller script:
public float movementTime;
public float rotationAmount;
public Quaternion newRotation;
void Start()
{
newRotation = transform.rotation;
}
void LateUpdate()
{
HandleMovementInput();
}
void HandleMovementInput()
{
if (Input.GetKey(KeyCode.Q))
{
newRotation *= Quaternion.Euler(Vector3.up * rotationAmount);
}
if (Input.GetKey(KeyCode.E))
{
newRotation *= Quaternion.Euler(Vector3.up * -rotationAmount);
}
transform.rotation = Quaternion.Lerp(transform.rotation, newRotation, Time.deltaTime * movementTime);
}
}