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?
asked Mar 28 '10 at 10:12 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!
answered Mar 28 '10 at 10:21 PM
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.
answered Mar 29 '10 at 10:43 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
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.
answered Sep 18 '10 at 04:33 PM
I tried to modify the pivot point as described here (http://x9productions.com/blog/?cat=3&lang=en_us&paged=4) but it strangely makes no difference, still it may work for others.
Max 2009 FBX 2009.3
I went with the empty game object method, for a quick fix it works a treat.
answered Aug 30 '10 at 12:20 AM