- Home /
Asset import from 3dsmax : rotation issue
Hello all,
A quick question. I've got a pre-fab that contains my 3D object that i created in max. In max the object sits at (0,0,1/2) and rotated (0,0,0), however, when Unity grabs hold on the auto-asset import, the model is rotated -90 degrees on the x axis in Unity, so it's like it's laying sideways / fallen over.
Is anyone aware of issues with rotations changing like such?
Can i create a pre-fab from instantiated objects in my level currently? So that it can manage to hold the rotation for a quick hack fix?
Thanks!
Bryan
I am having the same problem here, exporting in FBX 2014: Y-UP and Z-UP setting is ignored, the resulting FBX imported in Unity points down in the preview window, and is automatically rotated by -90 on the X axis when put in the scene.
If I rotate the pivot in $$anonymous$$ax (green UP) and export a FBX the model shows up correct in Unity: how is it possible that $$anonymous$$ax still has this problem? I experienced the exact same mess when using XNA years ago!
Answer by e-bonneville · Mar 28, 2010 at 10:21 PM
Yeah. I also had that extremely aggravating problem, except I was importing from Blender. There are several ways to fix this. Yes, you can do a hack fix by creating a prefab of the object, where it sits in an empty gameobject, rotated correctly. Any scripts applied to the object, you then apply to the prefab instead. This will ensure correct rotation, and correct behavior - if you rotate it and leave it outside of a gameobject, the axes will be pointing in funny directions. Another fix is to import it to Blender, bake the animations, and export as an FBX. Also, check the import settings and make sure there are no automatic rotations applied on import. Hope this helps!
Thanks. I actually found my transform.eulerAngles too and applied the rotation to the prefab. Strange thing is the pre-fab shows okay rotated when in Preview window, but instantiating they wont.
Right, so following for correct behavior on the first recommendation, just make sure that I'm applying the script actually to the prefab, and not the gameObj ins$$anonymous$$d of the prefab?
Thanks for the help =)
Yeah, if you put any scripts on the prefab that have anything to do with rotation, remember you rotated it 90 degrees, so anything you that you do to its rotation will be off by 90 degrees. Oh, and make sure your gameObj is directly in the center of the mesh, or else the rotations will still be off by however far your gameObj is from the mesh!
Also, if this answer works for you, be sure to vote it up so others in your situation will be able to find this (working) answer easier.
Answer by jlcnz · Aug 30, 2011 at 06:24 AM
As said, all you need to do is adjust the pivot.
In 3DS Max, you need to make sure in pivot rotation that the green arrow points up.
Easiest way to do this is select object, goto pivot tab, select affect pivot only, reset pivot, rotate pivote by 90 around the x axis
This did it for me... Unity does a -90 degree rotation upon import on the X axis. HOWEVER, when painting grass, this seems to be ignored. So a pivot rotation is essential.
Thank You so much. This problem was driving me crazy. After doing what you described everything is now working perfect!
2017 and this technique is still needed. I'm making assets for the Asset Store from $$anonymous$$ax and this really works. Just make sure the green arrow points up on the pivot.
Answer by alexnode · Mar 29, 2010 at 10:43 AM
There is a problem with the rotation when you import from max the x goes to 270 degrees . But the model is imported straight. It is an unnecessary Unity bug. If it comes by default on the side then apart from the bug there is a problem with your model. (At least with the latest fbx exporter available) here . To make sure that at least in max your model is correct. go to utilities and add resetXform then collapse the stack.
The old Skool way to resetxform in max (and Maya), is to create a cube at 0,0,0 -convert to poly - assign the same material with the model - attach your model - go to element mode select cube and delete. This way your pivot point will become the one of the deleted cube but you can do it with the xform utility too by moving the center and gizmo.
The game objects as elbon 96 said have 0,0,0 rotations so you can do your scripts there.
Okay cool. I tried the reset xform but still getting the rotation, so it looks like it's the unity bug. Thanks guys. I got it figured out pretty easily, just wanted to check out what others had exp'ed.
It is very annoying, there are reports that it creates problems with physics and many problems if you try to put a child under your model because it will rotate, apart from that if you make a tree it will come on the side in the landscape tools. There are workarounds for each case, I think... but very time consu$$anonymous$$g if you don't know what to do in the first place (like me) . You can vote in the wish list for a fix on the FBX importer
And to be honest I think that 3DS $$anonymous$$AX is not supported properly, I would like to see these problems in the $$anonymous$$AX importer page before I start working on a project.
As alexnode pointed out, you can vote for this to be fixed in official Unity uservoice-service: http://feedback.unity3d.com/forums/15792-unity/suggestions/210672-fbximporter-correct-orientation-and-without-game
Answer by vertex · Sep 18, 2010 at 04:33 PM
First use the "box method" to reset object transforms in max and then center the object and adjust the location of the object axis. This ensures that you have no funky transforms applied to the object axis before the next step.
For any object in 3D Studio Max before exporting also: rotate the object axis about the x axis 90 degrees within Max so that x(the red axis)remains the same, the blue axis points along what would be unity's z,and the green axis now points downward. Again, red stays the same (pointing right), the blue along the z forward (into the screen from front view in max) and the green pointing down.
You're not done yet. Export FBX to unity. Within unity ensure that BOTH the object's game object folder and the mesh object have 0 rotations. Unity's rotation scheme is a work around for 3D Studio Max's unique coordinate system. After setting Unity to 0, you should have an object that is oriented properly without rotation transforms within unity.
I would guess that the fewer transforms Unity has to put on an object just to get it scaled and oriented properly for the app., the quicker the object will render, so this could have a performance boost to get your rotations worked out ahead of time?
This problem is more with Max than Unity and goes way way back.
I'm using an older version of Max and FBX converter. Perhaps this has been fixed.
Answer by CupOfJoe · Aug 17, 2010 at 06:09 PM
In 3DS Max, make sure your pivot is rotated properly.
For example, I had a bowling pin that was upright in my views, but the pivot was showing that Z was vertical and Y was horizontal.
To rotate your pivot in Max:
- Turn on "Angle Snap Toggle."
- Go to your Hierarchy command panel>Affect Pivot only and rotate it.
When you save, your Unity file should update.