Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

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

    So Z axis points up.

    When creating characters, it seems like we usually make the character point in the y direction, -y in 3DS max since its coord handedness must be flipped. But then I have to rotate the character -90 which makes me think maybe the X axis is the forward vector.

    I know in my engine where I had a right handed coord system, -z was forward for me since y was my up. But in unreal it makes sense that y is forward since z is up and the coords are rotated.

    This will help me know which direction my objects need to face in the modeling program to be in the neutral position and what is the neutral direction of an object in the component editor.

    #2
    Yup, UE4 Forward axis is +x so from luckily for you with Max you already have Z-Up, in C4D land we are stuck with Y-Up and on import our Z-Forward = Y Forward in UE4, same problem with Maya. Hopefully they'll do some fixes for this in the importer one day...

    Comment


      #3
      Maya you can actually change it to Z-up axis work area so it becomes a moot point when working in maya - to - Ue4.

      Comment


        #4
        Not really as in Maya Y is forward when you change to Z-Up, still wrong for UE4 which is X Forward.

        Comment


          #5
          Are you sure that the Front axis is X ? when pressing the selecting the front view in the viewport it sets the camera at the Y axis as front.

          Comment


            #6
            Originally posted by Itamar_BN View Post
            Are you sure that the Front axis is X ? when pressing the selecting the front view in the viewport it sets the camera at the Y axis as front.
            Yes they are correct. "Forward X" is how all your models should be oriented in UE4, especially for skeletal meshes. Static meshes you place in the world aren't as important, but it is a good habit to orient all meshes in this way, aside from something like a cube, anything that has a clearly defined "front" side should be pointing forward X.
            Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

            Comment


              #7
              I will never get used to UE4s XYZ.
              Most of the time Z is up here, but with 2D planes Y is up, widgets have Z-order which is the depth not height, etc. inconsistency.

              Comment


                #8
                X is Forward, but you need to rotate your Character 90° so it looks Y forward.

                Comment


                  #9
                  Holy cow, going from unity to UE4, I always thinks of x as being horizontal and went down a math rabbit hole trying to figure out what I was doing wrong. X is forward, cripes

                  Comment


                    #10
                    well I'm guessing that this engine hasn't been made by mathematician as xyz are placed a very unusual way for me
                    X should be horizontal, Y vertical and Z deepness, if only they inverted Y and Z, but no, they changed everything with X deepness, Y horizon and Z vertical
                    I don't even find that logical as if they wanted to use axis like a computer Z should be top to bottom and Y left to right, and even that they managed to reverse it

                    so in this engine, if you want to go far away, you need to go negative X, if you want to go right negative Y (ok up is positive Z but well)

                    Comment


                      #11
                      Originally posted by Manatee View Post
                      I will never get used to UE4s XYZ.
                      Most of the time Z is up here, but with 2D planes Y is up, widgets have Z-order which is the depth not height, etc. inconsistency.
                      Did you mean Y is down? (Y- is up in widgets)

                      Comment


                        #12
                        I think what needs to be made clear is that the "front" view in the editor looks in the Y- direction. Meshes are imported facing Y+. Then when these Y+ facing meshes are used in the Pawn class the mesh is then rotated -90 deg on the Z axis so that the mesh is now facing X+. This works nicely with the MoveForward method in the Pawn class which positively affects the X axis. The GetActorForwardVector method in the Actor class will also return "forward" in the X+ direction.
                        The way I like to think of it is as a side scroller game and the character is facing X+. Now you become the character and are in first person view. You are still looking X+.

                        Comment


                          #13
                          Originally posted by Zectbumo54 View Post
                          I think what needs to be made clear is that the "front" view in the editor looks in the Y- direction. Meshes are imported facing Y+. Then when these Y+ facing meshes are used in the Pawn class the mesh is then rotated -90 deg on the Z axis so that the mesh is now facing X+. This works nicely with the MoveForward method in the Pawn class which positively affects the X axis. The GetActorForwardVector method in the Actor class will also return "forward" in the X+ direction.
                          The way I like to think of it is as a side scroller game and the character is facing X+. Now you become the character and are in first person view. You are still looking X+.
                          So what should we set which exporting fbx form blender, z up, x forward?

                          Comment


                            #14
                            I had good success with making my characters face down X instead of Y but market place assets all have characters facing down Y so I went back to that so I can reuse animations from the marketplace.

                            In Unreal +X is forward, +Z is up, +Y is left or right, I forget off the top of my head. I now always make everything face down X except for characters which I have facing Y and rotate them 90 degrees in game.

                            It's annoying to have to account for the 90 degree rotation sometimes because I do some things with IK on my character animations and it messes with the different coord spaces, but I've worked out most of the kinks. A lot of my IK is in world space so the math works out.

                            One annoying thing I've had to do was take a rotator of a character's head direction, and apply a 90 degree offset to it in C++. Otherwise the pitch ends up being roll due to the space mismatch and as your character looks up they actually roll their head side to side. I didn't find a way to do this in blueprint since blueprint just lets you add to the roll, pitch, yaw and doesn't expose quaternions or ways to transform a rotator by another rotator.

                            Code:
                            FTransform URDBaseGameplayStatics::WorldTransformToCharacterModelWorldTransform(const FTransform& InTransform)
                            {
                                FTransform Res(InTransform);
                                Res.ConcatenateRotation(FRotator(0.f, -90.f, 0.f).Quaternion());
                                return Res;
                            }

                            Comment


                              #15
                              Future dictionaries, when you look up the word "inconsistency", will have a section mentioning Unreal's mesh transform system as an example.
                              | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                              Comment

                              Working...
                              X