using System.Collections; using System.Collections.Generic; using UnityEngine; namespace NeonTea.Quakeball.Animation { /// Follows a Transform with configurable lerp speeds. public class LerpFollower : MonoBehaviour { public Transform Followed; public Vector3 PositionLerpSpeed = new Vector3(100, 100, 100); public Vector3 RotationLerpSpeed = new Vector3(100, 100, 100); public Vector3 ScaleLerpSpeed = new Vector3(100, 100, 100); private void Update() { transform.position.x = Mathf.Lerp(transform.position.x, Followed.position.x, PositionLerpSpeed.x); } } }