17 lines
428 B
C#
17 lines
428 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class SmoothFollow : MonoBehaviour
|
|
{
|
|
public Transform Tar;
|
|
Vector3 vSpeed;
|
|
public float Smooth;
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
transform.position = Vector3.SmoothDamp(transform.position, Tar.position, ref vSpeed, Smooth);
|
|
transform.rotation = Quaternion.Slerp(transform.rotation, Tar.rotation, Smooth);
|
|
}
|
|
}
|