using UnityEngine;
using System.Collections;
public class ExCube : MonoBehaviour {
public Transform Target;
Vector3 diff;
// Use this for initialization
void Start () {
}
public void GetDiff(){
diff = Target.position - transform.position;
}
// Update is called once per frame
void Update () {
diff = Target.position - transform.position;
transform.position += diff * Time.deltaTime * 2.0f;
GetDiff();
}
}
'Computer Language > 유니티' 카테고리의 다른 글
각도를 구해보자 (0) | 2014.04.29 |
---|---|
5열종대 헤쳐모여... (0) | 2014.04.29 |
z축으로 전진 잔진 (0) | 2014.04.29 |
Target.position.x 에 대한 고찰 (0) | 2014.04.29 |
차이를 이용하여 이동시켜 보잨ㅋㅋ (0) | 2014.04.29 |