Created
July 9, 2018 13:09
-
-
Save nopitech/6f104e955611f9a8cf07b09a87057f2d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class VectorScript : MonoBehaviour | |
{ | |
void Update() | |
{ | |
Vector3 from = Vector3.right * -5f; //現在地 | |
Vector3 to = transform.position; //目的地 | |
float smoothTime = Time.deltaTime * 0.1f; //移動スピード | |
Vector3 vel = Vector3.zero; //現在の速度 | |
transform.position = Vector3.SmoothDamp(from, to, ref vel, smoothTime); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment