1
0
mirror of synced 2024-12-18 09:15:54 +01:00
WACVR/Assets/Script/Essential/CameraSmooth.cs
xpeng 390c807f6c bugs fix
fix ipc touch not working bug;
fix player height text not updating bug
2022-10-07 17:12:42 +02:00

20 lines
512 B
C#

using UnityEngine;
[RequireComponent(typeof(Camera))]
public class CameraSmooth : MonoBehaviour {
public Transform target;
public float smoothSpeed = 0.05f;
public int FPS = 60;
private void Start()
{
QualitySettings.vSyncCount = 0;
Application.targetFrameRate = FPS;
}
void Update ()
{
if (target == null) return;
transform.position = Vector3.Lerp(transform.position, target.position, smoothSpeed);
transform.rotation = Quaternion.Lerp(transform.rotation, target.rotation, smoothSpeed);
}
}