What is considered forward in UE4, Y or X axis?

Math calculations in unreal assume X is forward, Z is up, and Y is right. So that’s kindof what you’re stuck with. It wouldn’t be easy to reconfigure that since every 3D math function in unreal would have to take that into account.

And Rotators are basically:
Yaw is rotation around the Z axis. Yaw is Left/Right and rotates around the axis that points up.
Pitch is rotation around the Y axis. Pitch is Up/Down and rotates around the axis that points right.
Roll is rotation around the X axis. Roll is “rolling” Left/Right and rotates around the axis that points forward.

It’s a totally arbitrary decision of which axis means what, but once it’s chosen, the entire 3D math of the engine is built around those assumptions.

Like if you take any Quaternion or Rotator with 0 rotation, and have it give you the direction vector, you’d get the vector (1, 0, 0).
If they chose Z to be the forward axis, you’d get (0, 0, 1).

You can totally write some functions that remap things but it’s easier to just get used to the 3D space of the tool you’re using, and when going between 3D applications with different spaces, do that remapping there.

I was able to easily tweak things with the Platformer starter project. Epic build the platformer level such that +Y was Left Right, +Z was up, and +X was the vector pointing out from the 2D game plane. confused me and I wanted +X to be Left Right. I was able to easily change all the logic to assume the character moved along X and was constrained to Y, and rotated the sample starter level 90 degrees. In case it was a totally arbitrary decision of whether or not X or Y was the character side to side plane in 2D. All the 3D math functions still assume X is forward, Z is up, Y is right.

1 Like