0
(0)

드디어 고대하시던 코딩의 시작입니다.

아래와 같이 Project 창에서 Assets 폴더 아래에 Scripts 폴더를 만들어 줍니다.

Scripts 폴더에 아래와 같이 PlayerMove 스크립트를 만들어 줍니다.

만들어진 PlayerMove 스크립트 파일을 작성하기 위해 더블 클릭하고, 키보드 A, D를 이용해 Player 가 좌우로 움직이도록 아래와 같이 스크립트를 작성해줍니다. 작성이 끝나면 Ctrl + S를 눌러 작성한 코드를 저장해 줍니다.

아래와 같이 방금 만든 PlayerMove 스크립트를 Player 게임 오브젝트의 컴포넌트로 추가해 줍니다.

이제 게임을 실행 후 키보드 A와 D를 눌러보면 Player가 좌우로 움직이는 것을 확인해 볼 수 있습니다.

전자책 구매 / home

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

GameInfo
Author: GameInfo

GameInfo


GameInfo

GameInfo

0개의 댓글

답글 남기기

아바타 플레이스홀더