4
0
This repository has been archived on 2023-09-23. You can view files and clone it, but cannot push or open issues or pull requests.
TremendousTaxi/game/Assets/Scripts/CameraController.cs

17 lines
397 B
C#
Raw Permalink Normal View History

2022-09-24 15:07:55 +02:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraController : MonoBehaviour
{
public Transform target;
public Transform targetCamera;
2022-09-25 10:29:51 +02:00
2022-09-24 15:07:55 +02:00
public float smoothSpeed = 0.1f;
void FixedUpdate() {
transform.position = Vector3.Lerp(transform.position, targetCamera.position, smoothSpeed);
transform.LookAt(target);
}
}