Skip to content

Instantly share code, notes, and snippets.

@nopitech
Created July 9, 2018 12:03
Show Gist options
  • Save nopitech/877da4a14954b32acce67b9175c462d6 to your computer and use it in GitHub Desktop.
Save nopitech/877da4a14954b32acce67b9175c462d6 to your computer and use it in GitHub Desktop.
using UnityEngine;
public class VectorScript : MonoBehaviour
{
void Update()
{
Vector3 current = Vector3.zero; //現在地
Vector3 target = Vector3.one*10; //目標値
float maxDist = Time.time; //進む距離
transform.position = Vector3.MoveTowards(current, target, maxDist);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment