반응형
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);
}
}
반응형
'Programing > unity' 카테고리의 다른 글
unity,유니티,3d 클릭시 이동,RaycastHit ,Raycast ,ScreenPointToRay (0) | 2017.02.25 |
---|---|
유니티,unity, text 추가,텍스트 추가 (0) | 2017.02.24 |
유니티,unity,클릭시 다른오브젝트 사라지게 하기 (0) | 2017.02.24 |
유니티,unity,키를 누를때 회전,nput.GetKey,KeyCode,transform.Rotate (0) | 2017.02.24 |
unity,유니티,transform.position. z 값 사용,GameObject 선언 (0) | 2017.02.23 |