# What dose the function GetScaledAxis( EAxis::Type InAxis ) do?

When I do the example about First Person Shooter C++ Tutorial,I meet a question,please see the following code:

``````   void AFPSCharacter::MoveForward(float Value)
{
if ((Controller != NULL) && (Value != 0.0f))
{
// find out which way is forward
FRotator Rotation = Controller->GetControlRotation();
// Limit pitch when walking or falling
if (GetCharacterMovement()->IsMovingOnGround() || GetCharacterMovement()->IsFalling())
{
Rotation.Pitch = 0.0f;
}
// add movement in that direction
const FVector Direction = FRotationMatrix(Rotation).GetScaledAxis(EAxis::X);
}
}
``````

I know MoveForward means add a offset to the controller’s Forward direction. I also understand the code FRotationMatrix(Rotation) means get matrix from a Rotation,Direction represent controller’s forward direction,it will be added a offset (Value int the code),but what dose the function GetScaledAxis mean? When I open source code in FMatrix.cpp,it only return a component of matrix (it is decided by the function’s parameter). There parameter is EAxis::X,so it will return FVector(M[0][0], M[0][1], M[0][2]) to Direction ,why? dose it mean the matrix’s X component represent forward direction? I feel so confuse about it. Now I even don’t know ue4 use right hand Coordinate or left hand Coordinate. In the level editor,the Z axis is upforward, Y axis is backforward, these are not like the form of opengl or directx, so it confuse me too. I hope someone can help me resolve this question,thanks!

API refrence explains:

Get axis of this matrix scaled by the
scale of the matrix

Also forget about DirectX and GL and use axis as editor shows them, because that valid thru out entire engine

Hello shadowriver. You mean I should put a new cognition about ue4’s coordinate system? Just use what is show in level editor dosen’t it?

You should use axis that you see in editor.

Thank you very much!

Also forget about DirectX and GL and use axis as editor shows them, because that valid thru out entire engine