public class CamWork : MonoBehaviour {
GameObject ball;
// Use this for initialization
void Start () {
ball = GameObject.Find("Ball");
}
// Update is called once per frame
void Update () {
transform.position = new Vector3(
ball.transform.position.x + 10,
ball.transform.position.y + 3,
0);
}
}
태그 : camera, GameObject.Find

덧글