커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
코드 입력한대로 움직이지 않습니다..
게임 개발이 처음이어도 쉽게 배우는 모바일 게임 개발 v0
2주차
북마크
조*신
댓글
1
추천
0
조회수
6
조회수
6
답변 완료



제가 1.4 캐릭터 움직이기를 듣고 있는데

르탄이를 좌우로 움직이게끔 조건문을 달아주고 있습니다.


왜 오류가 나오는지 잘 모르겠습니다 ㅠㅠ..




스파르타 즉문즉답스파르타 즉문즉답





작성한 코드 및 에러 메세지

[작성한 코드]

ublic class Rtan : MonoBehaviour

{

  float.direction = 0.05f;

   

  // Start is called before the first frame update

  void Start()

  {

    Application.targetFrameRate = 60;

    Debug.Log("안녕");

    direction = - 0.05f;

  }


  // Update is called once per frame

  void Update()

  {

    if(transform.position.x > 2.6f)

    {

      direction = - 0.05f;


    }

    if(transform.position.x < -2.6f)

    {

      direction = 0.05f;

    }


    transform.position += Vector3.right * direction;

  }

}



[에러 메세지]

All compiler errors have to be fixed before you can enter playmode!

UnityEditor.SceneView:ShowCompileErrorNotification ()




취소
 공유
취소
댓글 0
댓글 알림
나의얼굴