반응형
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 |