init 1.1.2
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace EmeraldAI.CharacterController
|
||||
{
|
||||
public class SmoothFollow : MonoBehaviour
|
||||
{
|
||||
public Vector3 CameraOffset;
|
||||
public Transform target;
|
||||
public float smoothTime = 0.3F;
|
||||
private Vector3 velocity = Vector3.zero;
|
||||
|
||||
void Update()
|
||||
{
|
||||
// Smoothly move the camera towards that target position
|
||||
transform.position = Vector3.SmoothDamp(transform.position, target.position + CameraOffset, ref velocity, smoothTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user