On the other hand, in code/blueprints, +X is the forward axis. Which means that if I use FindLookAtRotation(), my model will be rotated 90° to the right of where it should point.
Am I doing something horribly wrong, or does UE4 use two different definitions for forward?
I am pretty sure it is X but agree it is not always that clear. The new vehicle stuff uses X, unfortunately meshes from Cinema4D come in with Y forward and if you use Y-Up in Maya I think you get the meshes import with Y Forward too.
I think this may be a mistake as i can’t find a reason for it but skeletal meshes will import with Y forward. Notice though that even in their examples they make sure to rotate the mesh to face X forward in the character blueprint.
So skeletal meshes import Y forward but the controller expects the pawn/character to be X forward. Correct this in the blueprint or by using an offset of your own in C++ i guess.
I totally agree. This is a very odd issue. I can only guess this is a left over from UE3 where Epic engineers did some funky rotation on skeletal meshes to accommodate their artists wanting to work Y forward.
Forward is in the +X direction in Unreal coordinate system terms.
You can find out how the engine defines “forward” simply by looking at the ForwardVector constant on FVector class (there may be a way to inspect this through blueprints, but I haven’t tried).
FVector::ForwardVector = FVector(1,0,0); // X is forward
Similarly, you can look at the UpVector constant to get a feel for “up”:
In terms of importing models, I’m not sure how the pipeline handles models made in a different coordinate system, but I would imagine the Engine would somewhat respect/convert it to the right rotation based on the file. But if you are building out your blueprint or construction, you should definitely point the ‘front’ in the +X direction.
Yup it is X Forward, Z Up, which is different to everything else (Blender is -Y Forward, +Z Up, Maya (in z-up mode) is +Y Fwd, +Z Up etc.) but now we have the import translate, scale, rotate it has got to be less of a problem, be nice to be able to make those settings a preset though.
Meshes provided by Epic (eg “SK_Mannequin”) seem to always face along the +y axis.
Characters provided by Epic (eg “ThirdPersonCharacter”) seem to always have the Mesh component rotated 270 degrees around the z-axis so it faces along the +x axis. This then works with the concept that forward means along the +x axis.
Strangely, when using the UnrealEditor .fbx import tool with default settings it orients the imported mesh to point along the +x axis.
To work around this I change the import settings when using the fbx import tool to add a rotation of 90 around the z-axis so my imported mesh faces along the +y axis.