본문 바로가기
Programing/unity

유니티,unity,키를 누를때 회전,nput.GetKey,KeyCode,transform.Rotate

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

void Update () {

if (Input.GetKey (KeyCode.A)) {

             // a 키를 누를때

transform.Rotate (0.0f, 90.0f*Time.deltaTime, 0.0f);

// y축만 90도를 넣고 1초당 움직이게 Time.deltaTime 곱해줍니다.


}


if (Input.GetKey (KeyCode.D)) {

transform.Rotate (0.0f, -90.0f*Time.deltaTime, 0.0f);

}

}


반응형