Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Created March 1, 2018 03:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tsubaki/fa39e84afc4ac0ec2fdd326552468837 to your computer and use it in GitHub Desktop.
Save tsubaki/fa39e84afc4ac0ec2fdd326552468837 to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MoveTo : MonoBehaviour
{
[SerializeField]Transform target;
void Update ()
{
transform.position += Vector3.ClampMagnitude( target.position - transform.position, 0.3f);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment