2022-01-16 18:34:39 +01:00
|
|
|
using UnityEngine;
|
|
|
|
|
2022-01-26 00:03:29 +01:00
|
|
|
public class CameraSmooth : MonoBehaviour {
|
2022-01-16 18:34:39 +01:00
|
|
|
|
|
|
|
public Transform target;
|
|
|
|
public float smoothSpeed = 0.125f;
|
2022-03-04 21:18:48 +01:00
|
|
|
public Vector3 PositionOffset;
|
2022-03-09 20:52:38 +01:00
|
|
|
void Update ()
|
2022-01-16 18:34:39 +01:00
|
|
|
{
|
2022-03-04 21:18:48 +01:00
|
|
|
transform.position = Vector3.Lerp(transform.position, target.position + PositionOffset, smoothSpeed);
|
2022-01-16 18:34:39 +01:00
|
|
|
transform.rotation = Quaternion.Lerp(transform.rotation, target.rotation, smoothSpeed);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|