{"id":4734,"date":"2021-06-21T10:18:04","date_gmt":"2021-06-21T09:18:04","guid":{"rendered":"https:\/\/www.katsbits.com\/codex\/?p=4734"},"modified":"2023-09-07T15:50:55","modified_gmt":"2023-09-07T14:50:55","slug":"fbx-unity-rotation","status":"publish","type":"post","link":"https:\/\/www.katsbits.com\/codex\/fbx-unity-rotation\/","title":{"rendered":"FBX rotation fix for Unity"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_83 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a01e3a2a090b\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a01e3a2a090b\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.katsbits.com\/codex\/fbx-unity-rotation\/#rotate-on-x\" >Rotate on X<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.katsbits.com\/codex\/fbx-unity-rotation\/#apply-rotation-scale\" >Apply Rotation &#038; Scale<\/a><\/li><\/ul><\/nav><\/div>\n<p>Although <a href=\"https:\/\/unity.com\/\" rel=\"noopener\" target=\"_blank\">Unity<\/a> can import and work with *.blend files directly (<a href=\"https:\/\/www.blender.org\/download\/\" rel=\"noopener\" target=\"_blank\">Blenders<\/a> native file format) it&#8217;s often more useful to use <b>*.fbx<\/b> (FBX), largely because they don&#8217;t include extraneous scene data that has to be dealt with. However, because both Unity&#8217;s development environment and Blender 3D use different cardinal orientations &#8211; <i><b>Z<\/b> Up for Blender, <b>Y<\/b> Up for Unity<\/i> &#8211; exported content is often incorrectly rotated around the wrong axis; meshes that lay flat in Blender will appear standing upright for example. To fix this meshes need to be rotated prior to export in Blender.<\/p>\n<blockquote><p><b>Design note<\/b>: the orientation of a selection can be changed at export in Transform settings but not reliably. The information outlined below is a fail-safe option that sets the orientation at source forcing Blender and Unity to honour rotational data baked to the FBX file.<\/p><\/blockquote>\n<h3><span class=\"ez-toc-section\" id=\"rotate-on-x\"><\/span>Rotate on X<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To fix Blender exported meshes being incorrected rotated in Unity, once an Object is ready for export to *.fbx, in <b>Object Mode<\/b> select and then in <b>Object Properties<\/b> [1] or <b>Transform<\/b> properties of the Sidebar (<span class=\"shortcutkey\">N<\/span>), change the <b>Rotation<\/b> value of <b>X<\/b> to -90 degrees [2] (negative 90\u00b0), e.g. <b>X: -90\u00b0<\/b>.<\/p>\n<blockquote><p><b>Design note<\/b>: changes made to rotation are irrespective of an objects orientation in the 3D Viewport; an object lying on its back or standing upright should be similarly rotated &#8216;backwards&#8217;.<\/p><\/blockquote>\n<blockquote style=\"background-color: #fc0; color: #000;\"><p><b>Important<\/b>: confusingly Unity also uses the location, rotation and scale of objects at time of export so they may appear correctly when dropped into the 3D View [b] but not in the Asset Browser [a] preview and\/or Transform in the Inspector [c]. It&#8217;s important to address this problem so object coordinates are consistent and universal, especially in relation to the more advanced aspects of development.<\/p>\n<p><a href=\"https:\/\/www.katsbits.com\/images\/tutorials\/unity\/unity-wrong-rotation.jpg\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" style=\"width: 98.5%; height: auto;\" src=\"https:\/\/www.katsbits.com\/images\/tutorials\/unity\/unity-wrong-rotation.jpg\" alt=\"Incorrect rotation in Unity\" width=\"900px\" height=\"500px\" border=\"0\" \/><\/a><br \/>\n<i>Unity will use the orientation of objects at time of export from Blender so they may appear correct in some views [b] and editors but not in others [a &#038; c].<\/i><\/p><\/blockquote>\n<p><a href=\"https:\/\/www.katsbits.com\/images\/tutorials\/unity\/rotate-x-90.jpg\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" style=\"width: 100%; height: auto;\" src=\"https:\/\/www.katsbits.com\/images\/tutorials\/unity\/rotate-x-90.jpg\" alt=\"Rotate X axis 90 degree\" width=\"900px\" height=\"500px\" border=\"0\" \/><\/a><br \/>\n<i>Step 1: in Blender select the object prior to export and in <b>Object Properties<\/b> [1] rotate the X axis negative 90 degrees [2] in Transform properties. This rotates an object lying on its back, upright.<\/i><\/p>\n<h3><span class=\"ez-toc-section\" id=\"apply-rotation-scale\"><\/span>Apply Rotation &#038; Scale<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Once the necessary rotation value is set the object needs to be &#8216;fixed&#8217; otherwise the orientation data exported to the FBX will retain the original information instead of the update. To do this, with the object still selected, from the <b>Object<\/b> menu [3] select <b>Apply<\/b> then <b>Rotation &#038; Scale<\/b> [3] &#8211; <b><i>Object \u00bb Apply \u00bb Rotation &#038; Scale<\/i><\/b> (alternatively <span class=\"shortcutkey\">Ctrl<\/span> + <span class=\"shortcutkey\">A<\/span>). This fixes and resets the rotational value back to 0\u00b0 [4] &#8211; X now reads <b>X: 0\u00b0<\/b>. The file can then be exported to FBX and Unity.<\/p>\n<blockquote><p><b>Design note<\/b>: if content needs to be edited further, once rotated and set for Unity, objects can be (re)rotated back to their original orientation (in Object Mode &#8211; they will then appear rotated on X by +90 degrees, i.e. X: 90\u00b0). Any subsequent changes to the file can then be exported without rotating again because the X value is relative to the object (local) rather than the scene (global).<\/p>\n<p><a href=\"https:\/\/www.katsbits.com\/images\/tutorials\/unity\/editing-rotation.jpg\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" style=\"width: 98.5%; height: auto;\" src=\"https:\/\/www.katsbits.com\/images\/tutorials\/unity\/editing-rotation.jpg\" alt=\"Rotate for editing\" width=\"900px\" height=\"500px\" border=\"0\" \/><\/a><br \/>\n<i>If objects need to be edited they can be rotated back to their original position [d] and exported in-situ once done &#8211; the X value is relative so will export correctly orientated for Unity [e].<\/i><\/p><\/blockquote>\n<p><a href=\"https:\/\/www.katsbits.com\/images\/tutorials\/unity\/apply-rotation.jpg\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" style=\"width: 100%; height: auto;\" src=\"https:\/\/www.katsbits.com\/images\/tutorials\/unity\/apply-rotation.jpg\" alt=\"Apply Rotation &#038; Scale\" width=\"900px\" height=\"500px\" border=\"0\" \/><\/a><br \/>\n<i>Step 2: once the rotation is set it needs to be fixed using <b>Apply<\/b> and <b>Rotation &#038; Scale<\/b> [3] to reset the value back to 0 [4] with the mesh in the new orientation.<\/i><\/p>\n<p><a href=\"https:\/\/www.katsbits.com\/images\/tutorials\/unity\/unity-correct-rotation.jpg\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" style=\"width: 100%; height: auto;\" src=\"https:\/\/www.katsbits.com\/images\/tutorials\/unity\/unity-correct-rotation.jpg\" alt=\"Correct rotation in Unity\" width=\"900px\" height=\"500px\" border=\"0\" \/><\/a><br \/>\n<i>Once rotation has been fixed in Blender the imported asset will then be correctly orientated in Unity, in the Inspector [5], main 3D View [6] and Asset Brower [7] (subject to yellow boxout above).<\/i><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":4746,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34,230,831],"tags":[203,576,413,351,799],"class_list":["post-4734","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blender","category-tutorials","category-unity","tag-fbx","tag-object-properties","tag-rotation","tag-transform","tag-unity"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.katsbits.com\/codex\/wp-json\/wp\/v2\/posts\/4734","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.katsbits.com\/codex\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.katsbits.com\/codex\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.katsbits.com\/codex\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.katsbits.com\/codex\/wp-json\/wp\/v2\/comments?post=4734"}],"version-history":[{"count":19,"href":"https:\/\/www.katsbits.com\/codex\/wp-json\/wp\/v2\/posts\/4734\/revisions"}],"predecessor-version":[{"id":5025,"href":"https:\/\/www.katsbits.com\/codex\/wp-json\/wp\/v2\/posts\/4734\/revisions\/5025"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.katsbits.com\/codex\/wp-json\/wp\/v2\/media\/4746"}],"wp:attachment":[{"href":"https:\/\/www.katsbits.com\/codex\/wp-json\/wp\/v2\/media?parent=4734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.katsbits.com\/codex\/wp-json\/wp\/v2\/categories?post=4734"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.katsbits.com\/codex\/wp-json\/wp\/v2\/tags?post=4734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}