ue4 2022/05/02 tick

2022. 5. 2. 00:50·Unreal Engine 4/Unreal Engine 4
반응형
void ACC_KangnamMain::Tick(float DeltaTime)
{
   Super::Tick(DeltaTime);

   if(Current_PlayerRotation!=Stop_walk)
   {
      SetActorRotation(FRotator(0.f, StoC.Direction+cDirection, 0.f));
      AddMovementInput(GetActorForwardVector(),1);
      Store_State=Current_PlayerRotation+cDirection;
   }
   else
   {
      SetActorRotation(FRotator(0.f,Store_State,0.f));
      AddMovementInput(GetActorForwardVector(),0);
   }
   
   if(ForwardCheckValue!=FState)
   {
      ForwardCheckValue=FState;
      Move_ResultData=ForwardCheckValue+RightCheckValue;
      switch (Move_ResultData)
      {
      case 0:
         Current_PlayerRotation=Stop_walk;
         break;
      case 1:
         Current_PlayerRotation=Left_walk;
         break;
      case 2:
         Current_PlayerRotation=Right_walk;
         break;
      case 4:
         Current_PlayerRotation=Forward_walk;
         break;
      case 5:
         Current_PlayerRotation=LF_walk;
         break;
      case 6:
         Current_PlayerRotation=RF_walk;
         break;
      case 7:
         Current_PlayerRotation=Backward_walk;
         break;
      case 8:
         Current_PlayerRotation=LB_walk;
         break;
      case 9:
         Current_PlayerRotation=RB_walk;
         break;
      default:
         break;
      }
      Server_VisibleAreaMove();
   }
   if(RightCheckValue!=RState)
   {
      RightCheckValue=RState;
      Move_ResultData=ForwardCheckValue+RightCheckValue;
      switch (Move_ResultData)
      {
      case 0:
         Current_PlayerRotation=Stop_walk;
         break;
      case 1:
         Current_PlayerRotation=Left_walk;
         break;
      case 2:
         Current_PlayerRotation=Right_walk;
         break;
      case 4:
         Current_PlayerRotation=Forward_walk;
         break;
      case 5:
         Current_PlayerRotation=LF_walk;
         break;
      case 6:
         Current_PlayerRotation=RF_walk;
         break;
      case 7:
         Current_PlayerRotation=Backward_walk;
         break;
      case 8:
         Current_PlayerRotation=LB_walk;
         break;
      case 9:
         Current_PlayerRotation=RB_walk;
         break;
      default:
         break;
      }
      Server_VisibleAreaMove();
   }
   float rot = GetControlRotation().Yaw+22.5;
   if(rot>360)
      rot=rot-360;
   float rotCheck= rot/45;
   if((rotCheck>=0.0f)&&(rotCheck<1.0f))
   {
      cDirection=0.0f;
   }
   else if((rotCheck>=1.0f)&&(rotCheck<2.0f))
   {
      cDirection=45.0f;
   }
   else if((rotCheck>=2.0f)&&(rotCheck<3.0f))
   {
      cDirection=90.0f;
   }
   else if((rotCheck>=3.0f)&&(rotCheck<4.0f))
   {
      cDirection=135.0f;
   }
   else if((rotCheck>=4.0f)&&(rotCheck<5.0f))
   {
      cDirection=180.0f;
   }
   else if((rotCheck>=5.0f)&&(rotCheck<6.0f))
   {
      cDirection=225.0f;
   }
   else if((rotCheck>=6.0f)&&(rotCheck<7.0f))
   {
      cDirection=270.0f;
   }
   else if((rotCheck>=7.0f)&&(rotCheck<8.0f))
   {
      cDirection=315.0f;
   }
   //GEngine->AddOnScreenDebugMessage(-1,2.0,FColor::Red,FString::Printf(TEXT("%f"),rotCheck));
}
반응형
저작자표시 (새창열림)

'Unreal Engine 4 > Unreal Engine 4' 카테고리의 다른 글

2022/04/12 백업본  (0) 2022.04.12
2022/04/07 로비메뉴 백업  (1) 2022.04.07
2022/03/29 360도 캐릭터 백업  (0) 2022.03.29
OrbitingMovement 컴포넌트 생성  (0) 2022.03.24
계층구조 만들기  (0) 2022.03.22
'Unreal Engine 4/Unreal Engine 4' 카테고리의 다른 글
  • 2022/04/12 백업본
  • 2022/04/07 로비메뉴 백업
  • 2022/03/29 360도 캐릭터 백업
  • OrbitingMovement 컴포넌트 생성
숯불돼지왕갈비
숯불돼지왕갈비
  • 숯불돼지왕갈비
    게임 개발 공부기
    숯불돼지왕갈비
  • 전체
    오늘
    어제
    • 분류 전체보기 (303) N
      • 학교수업 (165)
      • 취업강의 (6)
      • C++ (46) N
        • 코딩 테스트 (4)
      • Unreal Engine 5 (25)
        • MMORPG 개발 (25)
      • Unreal Engine 4 (44)
        • Omak Project (3)
        • Unreal Engine 4 개발일지 (9)
        • Unreal Engine 4 (32)
      • Unity (1)
        • 개발 일지 (1)
      • 수학 (3)
        • 소프트웨어 공학용 수학 (3)
      • DirectX 11 (4)
      • 게임 디자인 패턴 (2)
      • 포트폴리오 (1)
      • 자격증 (1)
        • 정보처리기사 (0)
        • SQLD (0)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.0
숯불돼지왕갈비
ue4 2022/05/02 tick
상단으로

티스토리툴바