0
(0)

스페이스바를 눌러 Player가 점프하도록 만들어 보겠습니다.

PlayerMove 스크립트를 열어 아래와 같이 관련 변수를 먼저 정의해 줍니다.

위에서 정의한 변수들의 초기값을 작성해 줍니다.

스페이스바를 눌렀을 때 항상 점프할 수 있도록 Update() 메서드 안에 아래와 같이 코드를 작성해 줍니다.

아래와 같이 충돌관련 메서드를 이용해 Player가 바닥에 있는 상태인지 점프한 상태인지 판단해 줍니다.

게임을 플레이해 스페이스바를 눌러보시면 Player가 점프하는 것을 확인하실 수 있습니다.

C# 소스 / 전자책 구매 / 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개의 댓글

답글 남기기

아바타 플레이스홀더