Assignment for RMIT Mixed Reality in 2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

25 lines
634 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace EMD.DemoUtility
{
public class SmoothFollowBehaviour : MonoBehaviour
{
[SerializeField]
private Transform m_Target;
[SerializeField]
private float m_SmoothValue = 0.5f;
void LateUpdate()
{
if (m_Target != null)
{
transform.position = Vector3.Lerp(transform.position, m_Target.position, m_SmoothValue);
transform.rotation = Quaternion.Lerp(transform.rotation, m_Target.rotation, m_SmoothValue);
}
}
}
}