본문 바로가기
Programing/unity

unity,유니티,배경무한반복

by 고니피즈 2017. 2. 24.
반응형

public class bgmove : MonoBehaviour {


//이미지 처음 x좌표  70, 마지막 x 좌표는 -70 을 기준으로 


public float speed= 10f;


void Start () {

transform.position = new Vector3 (70,0,0);

}

// Update is called once per frame

void Update () {

if(transform.position.x < -70){

transform.position = new Vector3 (70,0,0);


}

transform.Translate (-speed * Time.deltaTime, 0, 0);


}

}


반응형