1
0
mirror of https://github.com/xiaopeng12138/MaiDXR.git synced 2025-02-14 18:02:35 +01:00
MaiDXR/Assets/Scripts/CameraSmooth.cs

15 lines
378 B
C#
Raw Normal View History

2022-01-16 18:34:39 +01:00
using UnityEngine;
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);
}
}