Tutorial: 3D cursor and player with smoothing

I did a test myself to see how can I make an object follow another object with smoothing.

Here’s the code:

using UnityEngine;
using System.Collections;

public class TransformSmooth : MonoBehaviour
{
	public Transform target;
	public float smoothing = 1f;

	void Start ()
	{
	}

	void Update ()
	{
		transform.position = Vector3.Lerp(transform.position, target.position, smoothing * Time.deltaTime);
	}

}

444065–15437–$Linear interpolation.rar (114 KB)

Thanks for this, I was trying to think of ways I could do something similar on a project of mine :slight_smile:

Thanks, have fun! :slight_smile: