using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MoveCamera : MonoBehaviour
{
private Vector3 Target;
private Vector3 cameraStartPosition;
private bool isLerping;
public float Speed;
public void CameraPosition1()
{
isLerping = true;
cameraStartPosition = transform.position;
Target = new Vector3(30f, 2.5f, -5f);
}
public void CameraPosition2()
{
isLerping = true;
cameraStartPosition = transform.position;
Target = new Vector3(-30f, 10f, 200f);
}
void FixedUpdate()
{
if (isLerping)
{
transform.position = Vector3.Lerp(cameraStartPosition, Target, Speed * Time.deltaTime);
}
}
}
How can I lerp my camera rotation as well? I want the first position to have rotation of 270, and the second 90.