UE5高薪就业班-零基础·学虚幻·月薪过万 扫二维码继续学习 二维码时效为半小时

(1评价)
价格: 13800.00元

    FRotator Rotation = Controller->GetControlRotation();
    FRotator YawRotation(0.0f, Rotation.Yaw, 0.0f);
    FVector Direction = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X);
    AddMovementInput(Direction, Value);、

在第三人称全视角下,视角看向的方向为正方向移动方法。

[展开全文]

void AMainPlayer::MoveForward(float Value)
{

const FRotator Rotation = Controller->GetcontrolRotation();
const FRotator YawRotation(0.0f,Rotation.Yaw, 0.0f);

const FVector Direction=FRotationMatrix(YawRotation).GetUnitAxis(EAxis: :X),
AddMovementInput(Direction,Value);

}
void AMainPlayer::MoveRight(float Value)
{

const FRotator Rotation = Controller->GetcontrolRotation():const FRotator YawRotation(0.0f,Rotation.Yaw,0.0f);const FVector Direction = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::Y),
AddMovementInput(Direction,Value);

}

[展开全文]
老师_KK · 02-28 · 0