Question by
karim-123 · Jun 13, 2021 at 11:55 AM ·
rotationphysics3dquaternionquaternions
Make camera have same rotation but with an offset
So i have a car and a camera and so far here is the camera script:
public GameObject car;
public Vector3 offset;
void Start()
{
offset = transform.position - car.transform.position;
}
// Update is called once per frame
void FixedUpdate()
{
transform.position = transform.position = Vector3.Lerp(transform.position, car.transform.position + offset, 0.8f);
}
}
This makes the camera smoothly move with the car, but now i want the camera to also have the same rotation as the car but with the starting offset.
Comment