I've just recently been introduced to Time.deltaTime
and lerping and have been kinda stuck for the past few days.
So when I plug in Time.deltaTime
for the last float
and then multiply by another float variable called speed
, what exactly is happening? What is Time.deltaTime
doing to speed
each frame that gives the end result?
Thank you!!
public class CameraMovement : MonoBehaviour
{
public GameObject followTarget;
public float moveSpeed;
void Update()
{
if (followTarget != null)
{
transform.position = Vector3.Lerp(transform.position, followTarget.transform.position, moveSpeed * Time.deltaTime);
}
}
}